-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ability to control using position with file scoped namespaces (#170)
* Slight refactor of the compilation unit strategies, ability to control using position with file scoped namespaces * Switching to replacenode for target types * Adding more regen tests * VS2019 compatibility * Stop filescoped tests running in 2019 build * Urgh
- Loading branch information
1 parent
efbdf70
commit 2e9b3ee
Showing
12 changed files
with
252 additions
and
61 deletions.
There are no files selected for viewing
71 changes: 71 additions & 0 deletions
71
src/Unitverse.Core.Tests/RegenerationTestClasses.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/Unitverse.Core.Tests/Resources/Regeneration-FileScopedUsingsOutside.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// # EmitUsingsOutsideNamespace=true | ||
// # GenerateFileScopedNamespaces=true | ||
namespace TestNamespace.SubNameSpace; | ||
|
||
public class TestClass | ||
{ | ||
public TestClass(string stringProp) | ||
{ | ||
|
||
} | ||
|
||
public void ThisIsAMethod(string methodName, int methodValue) | ||
{ | ||
System.Console.WriteLine("Testing this"); | ||
} | ||
|
||
public string WillReturnAString() | ||
{ | ||
return "Hello"; | ||
} | ||
} | ||
------------------- | ||
namespace TestNamespace.SubNameSpace; | ||
|
||
public class TestClass | ||
{ | ||
public TestClass(string stringProp) | ||
{ | ||
|
||
} | ||
|
||
public void ThisIsAMethod(string methodName, int methodValue) | ||
{ | ||
System.Console.WriteLine("Testing this"); | ||
} | ||
|
||
public string WillReturnAString() | ||
{ | ||
return "Hello"; | ||
} | ||
|
||
public string WillAlsoReturnAString(string input) | ||
{ | ||
return "Hello"; | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
src/Unitverse.Core.Tests/Resources/Regeneration-FileScopedUsingsOutsideMultipleClasses.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// # EmitUsingsOutsideNamespace=true | ||
// # GenerateFileScopedNamespaces=true | ||
namespace TestNamespace.SubNameSpace; | ||
|
||
public class TestClass | ||
{ | ||
public TestClass(string stringProp) | ||
{ | ||
|
||
} | ||
|
||
public void ThisIsAMethod(string methodName, int methodValue) | ||
{ | ||
System.Console.WriteLine("Testing this"); | ||
} | ||
|
||
public string WillReturnAString() | ||
{ | ||
return "Hello"; | ||
} | ||
} | ||
|
||
public class C2 | ||
{ | ||
public void SomeMethod() { } | ||
} | ||
------------------- | ||
namespace TestNamespace.SubNameSpace; | ||
|
||
public class TestClass | ||
{ | ||
public TestClass(string stringProp) | ||
{ | ||
|
||
} | ||
|
||
public void ThisIsAMethod(string methodName, int methodValue) | ||
{ | ||
System.Console.WriteLine("Testing this"); | ||
} | ||
|
||
public string WillReturnAString() | ||
{ | ||
return "Hello"; | ||
} | ||
|
||
public string WillAlsoReturnAString(string input) | ||
{ | ||
return "Hello"; | ||
} | ||
} | ||
|
||
public class C2 | ||
{ | ||
public void SomeMethod() { } | ||
|
||
public void SomeOtherMethod() { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.