Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use attribute instead of base class for MSTest #1193

Merged
merged 74 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
3f952bf
Clone VerifyBase -> Verifier
MattKotsenas Apr 12, 2024
0b41bfb
Forward VerifyBase calls to Verifier
MattKotsenas Apr 13, 2024
0114f84
Move to-be-generated code to region
MattKotsenas Apr 13, 2024
5180715
Clean up deprecation comments
MattKotsenas Apr 13, 2024
e9b3aab
Initial implementation of source generator
MattKotsenas May 8, 2024
e7c6e89
Add basic tests -- namespaces incorrect
MattKotsenas May 8, 2024
833b7bc
Fix incorrect namespacing
MattKotsenas May 8, 2024
3e0d747
Handle nested partial classes
MattKotsenas May 9, 2024
86b0445
Add autogenerted header to top of generated source file
MattKotsenas May 10, 2024
0649dc6
Refactor IndentedStringBuilder for chaining and reduced allocations
MattKotsenas May 10, 2024
4126d4e
Fix invalid generated code
MattKotsenas May 11, 2024
f34fb5d
Fix nullable namespace
MattKotsenas May 11, 2024
b122ef0
Partial classes don't need to specify type constraints
MattKotsenas May 11, 2024
941331c
Simplify ParentClass to use a stack instead of a LinkedList
MattKotsenas May 11, 2024
a275e12
Write all generated classes to a single file to avoid ambiguous hint …
MattKotsenas May 12, 2024
7b5a9c3
Extract parsing to its own class
MattKotsenas May 12, 2024
d64246b
Simplify how type parameters are handled
MattKotsenas May 12, 2024
b981557
Simplify StringBuilder usage
MattKotsenas May 12, 2024
fd8652e
Simplify StringBuilder usage
MattKotsenas May 13, 2024
9e29380
Use EquatableArray
MattKotsenas May 13, 2024
c8cff10
Clean up namespaces and usings
MattKotsenas May 13, 2024
3cd57c8
Add source generator to main package
MattKotsenas May 13, 2024
79d5b15
Existing tests pass (still need to write / convert new ones)
MattKotsenas May 13, 2024
212b18e
Use reflection + lookup cache to speed up getting types
MattKotsenas May 14, 2024
7878ef3
Add comments and clean up exceptions
MattKotsenas May 14, 2024
5abb182
Fix Source Generator to not double-emit property in inheritence
MattKotsenas May 14, 2024
4527a66
Switch tests over to attribute
MattKotsenas May 14, 2024
74eeef5
Clean up tests
MattKotsenas May 14, 2024
93ed3b2
Fix xmldocs
MattKotsenas May 14, 2024
a71b0cd
Update package and docs
MattKotsenas May 14, 2024
d0838bd
Clean up code comments
MattKotsenas May 15, 2024
22acb43
Merge branch 'main' into pr/1193
SimonCropp May 15, 2024
fb27e09
Merge branch 'main' into pr/1193
SimonCropp May 15, 2024
7af840b
cleanup
SimonCropp May 15, 2024
b0a2673
Add comment for UnsafeAccessor
MattKotsenas May 15, 2024
b2f3697
Verify generators are cachable
MattKotsenas May 15, 2024
addedd1
global usings
SimonCropp May 16, 2024
5c2374f
Create VerifyMSTest.slnf
SimonCropp May 16, 2024
20bdab7
global usings
SimonCropp May 16, 2024
dbdc1ed
redundant private
SimonCropp May 16, 2024
cfaedbd
use computed properties
SimonCropp May 16, 2024
3200e02
use some target typed new
SimonCropp May 16, 2024
33729b7
suppress some ReSharper hints
SimonCropp May 16, 2024
504c718
redundant inits
SimonCropp May 16, 2024
823caf3
Update EquatableArray.cs
SimonCropp May 16, 2024
d4eb826
redundant private
SimonCropp May 16, 2024
c1be138
fix cancel name
SimonCropp May 16, 2024
71ef509
Update UsesVerifyGenerator.cs
SimonCropp May 16, 2024
3be21d6
primary constructors
SimonCropp May 16, 2024
2a684a3
remove redundant private
SimonCropp May 16, 2024
d4748d5
remove redundant namespaces
SimonCropp May 16, 2024
2c77061
Merge branch 'main' into pr/1193
SimonCropp May 16, 2024
a0d1d57
Merge branch 'main' into pr/1193
SimonCropp May 16, 2024
db1b980
cleanup
SimonCropp May 16, 2024
18a7032
cleanup
SimonCropp May 16, 2024
a75b0e6
Update Tests.cs
SimonCropp May 16, 2024
9dad2a6
cleanup
SimonCropp May 16, 2024
942f581
redundant namespaces
SimonCropp May 16, 2024
902a9c6
use file scoped namespace
SimonCropp May 16, 2024
dd8fc71
Revert "use file scoped namespace"
SimonCropp May 16, 2024
b15a2bd
Merge branch 'main' into pr/1193
SimonCropp May 16, 2024
4665eda
fix merge
SimonCropp May 16, 2024
c07eaaf
redundant namespace
SimonCropp May 16, 2024
be8864d
redundant namespaces
SimonCropp May 16, 2024
c24e5b0
cleanup
SimonCropp May 16, 2024
64f72fc
cleanup
SimonCropp May 16, 2024
115f0c9
cleanup
SimonCropp May 16, 2024
36684cf
simplify string building
SimonCropp May 16, 2024
ae27278
simplify string building
SimonCropp May 16, 2024
e421f5f
Replace TrackingNames reflection with simple array
MattKotsenas May 16, 2024
bc274b1
Partially revert "simplify string building" to reduce allocations
MattKotsenas May 16, 2024
155dc19
Remove namespace check when serarching for TestContext property
MattKotsenas May 16, 2024
225f1e8
Move TestContext reflection to helper class
MattKotsenas May 16, 2024
27bca2c
Remove HashCode and EquatableArray classes and implement equals directly
MattKotsenas May 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/naming.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ public class UniqueForSample
<a id='snippet-UniqueForSampleMSTest'></a>
```cs
[TestClass]
public class UniqueForSample :
VerifyBase
[UsesVerify]
public partial class UniqueForSample
{
[TestMethod]
public Task Runtime()
Expand Down Expand Up @@ -618,7 +618,7 @@ Verifier.DerivePathInfo(
<!-- snippet: DerivePathInfoMSTest -->
<a id='snippet-DerivePathInfoMSTest'></a>
```cs
DerivePathInfo(
Verifier.DerivePathInfo(
(sourceFile, projectDirectory, type, method) => new(
directory: Path.Combine(projectDirectory, "Snapshots"),
typeName: type.Name,
Expand Down
8 changes: 4 additions & 4 deletions docs/parameterised.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ public Task TestCaseUsage(string arg) =>
<a id='snippet-MSTestDataRow'></a>
```cs
[TestClass]
public class ParametersSample :
VerifyBase
[UsesVerify]
public partial class ParametersSample
{
[DataTestMethod]
[DataRow("Value1")]
Expand Down Expand Up @@ -516,8 +516,8 @@ Hashing parameter is achieved by using `UseParameters` in combination with `Hash
<a id='snippet-UseParametersHashMsTest'></a>
```cs
[TestClass]
public class ParametersHashSample :
VerifyBase
[UsesVerify]
public partial class ParametersHashSample
{
[DataTestMethod]
[DataRow("Value1")]
Expand Down
8 changes: 4 additions & 4 deletions docs/scrubbers.md
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,8 @@ public class ScrubbersSample
<a id='snippet-ScrubbersSampleMSTest'></a>
```cs
[TestClass]
public class ScrubbersSample :
VerifyBase
[UsesVerify]
public partial class ScrubbersSample
{
[TestMethod]
public Task Lines()
Expand Down Expand Up @@ -789,8 +789,8 @@ public class ScrubberLevelsSample
<a id='snippet-ScrubberLevelsSampleMSTest'></a>
```cs
[TestClass]
public class ScrubberLevelsSample :
VerifyBase
[UsesVerify]
public partial class ScrubberLevelsSample
{
VerifySettings classLevelSettings;

Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/Linux_Other_Cli_MSTest_AppVeyor.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ dotnet tool install -g verify.tool
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/Linux_Other_Cli_MSTest_AzureDevOps.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ dotnet tool install -g verify.tool
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/Linux_Other_Cli_MSTest_GitHubActions.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ dotnet tool install -g verify.tool
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/Linux_Other_Cli_MSTest_None.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ dotnet tool install -g verify.tool
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/Linux_Other_Gui_MSTest_AppVeyor.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public static void Initialize() =>
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/Linux_Other_Gui_MSTest_AzureDevOps.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public static void Initialize() =>
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/Linux_Other_Gui_MSTest_GitHubActions.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public static void Initialize() =>
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/Linux_Other_Gui_MSTest_None.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public static void Initialize() =>
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/Linux_Rider_Cli_MSTest_AppVeyor.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ dotnet tool install -g verify.tool
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/Linux_Rider_Cli_MSTest_AzureDevOps.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ dotnet tool install -g verify.tool
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/Linux_Rider_Cli_MSTest_GitHubActions.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ dotnet tool install -g verify.tool
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/Linux_Rider_Cli_MSTest_None.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ dotnet tool install -g verify.tool
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/Linux_Rider_Gui_MSTest_AppVeyor.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ public static void Initialize() =>
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/Linux_Rider_Gui_MSTest_AzureDevOps.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ public static void Initialize() =>
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/Linux_Rider_Gui_MSTest_GitHubActions.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ public static void Initialize() =>
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/Linux_Rider_Gui_MSTest_None.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ public static void Initialize() =>
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/MacOS_Other_Cli_MSTest_AppVeyor.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ dotnet tool install -g verify.tool
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/MacOS_Other_Cli_MSTest_AzureDevOps.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ dotnet tool install -g verify.tool
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/MacOS_Other_Cli_MSTest_GitHubActions.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ dotnet tool install -g verify.tool
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/MacOS_Other_Cli_MSTest_None.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ dotnet tool install -g verify.tool
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/MacOS_Other_Gui_MSTest_AppVeyor.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public static void Initialize() =>
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/MacOS_Other_Gui_MSTest_AzureDevOps.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public static void Initialize() =>
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/MacOS_Other_Gui_MSTest_GitHubActions.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public static void Initialize() =>
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/MacOS_Other_Gui_MSTest_None.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public static void Initialize() =>
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/MacOS_Rider_Cli_MSTest_AppVeyor.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ dotnet tool install -g verify.tool
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/MacOS_Rider_Cli_MSTest_AzureDevOps.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ dotnet tool install -g verify.tool
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/MacOS_Rider_Cli_MSTest_GitHubActions.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ dotnet tool install -g verify.tool
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/MacOS_Rider_Cli_MSTest_None.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ dotnet tool install -g verify.tool
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/MacOS_Rider_Gui_MSTest_AppVeyor.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ public static void Initialize() =>
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
4 changes: 2 additions & 2 deletions docs/wiz/MacOS_Rider_Gui_MSTest_AzureDevOps.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ public static void Initialize() =>
<a id='snippet-SampleTestMSTest'></a>
```cs
[TestClass]
public class Sample :
VerifyBase
[UsesVerify]
public partial class Sample
{
[TestMethod]
public Task Test()
Expand Down
Loading