Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
24b7c83
feat: add NUnit and MSTest migration analyzers and code fixers
thomhurst Sep 23, 2025
841edef
docs: add NUnit and MSTest migration guides
thomhurst Sep 24, 2025
fbb4798
fix: add missing using directive for MigrationHelpers in code fixers
thomhurst Sep 24, 2025
ee4c39e
Merge branch 'main' into feature/nunit-migrate
thomhurst Sep 24, 2025
70c484c
fix: add missing diagnostic verifications for MSTest and NUnit migrat…
thomhurst Sep 24, 2025
0a9cee1
fix: address critical issues in migration analyzers
claude[bot] Sep 24, 2025
89f3daa
Merge branch 'main' into feature/nunit-migrate
thomhurst Oct 2, 2025
bea79c6
Merge branch 'main' into feature/nunit-migrate
thomhurst Oct 8, 2025
e42ba6c
Merge branch 'main' into feature/nunit-migrate
thomhurst Oct 10, 2025
f5936d8
refactor: enhance attribute analysis to return location for diagnostics
thomhurst Oct 10, 2025
30d8f60
refactor: include brackets location in attribute analysis
thomhurst Oct 11, 2025
7a80e69
refactor: reorganize migration process and enhance framework type det…
thomhurst Oct 11, 2025
368aaab
refactor: update assertion conversion methods to return ExpressionSyn…
thomhurst Oct 12, 2025
f7e8772
Merge branch 'main' into feature/nunit-migrate
thomhurst Oct 12, 2025
6fbf564
refactor: update assertion methods to return ExpressionSyntax for imp…
thomhurst Oct 12, 2025
0d6cf5c
refactor: enhance migration analyzers and tests for TUnit compatibility
thomhurst Oct 12, 2025
e1b5c54
refactor: add solution transform to normalize line endings for cross-…
thomhurst Oct 12, 2025
bcf7007
refactor: replace DefaultVerifier with LineEndingNormalizingVerifier …
thomhurst Oct 12, 2025
066c33f
refactor: update NormalizeLineEndings method to ensure platform-nativ…
thomhurst Oct 12, 2025
70ce7b6
refactor: update NormalizeLineEndings method to ensure CRLF line endi…
thomhurst Oct 12, 2025
1905377
refactor: format document in BaseMigrationCodeFixProvider to ensure c…
thomhurst Oct 12, 2025
00da093
refactor: remove unused NUnitMigrationAnalyzerTests methods for clean…
thomhurst Oct 12, 2025
e53508b
fix: normalize line endings to CRLF after formatting for cross-platfo…
thomhurst Oct 12, 2025
8468d0d
refactor: remove unnecessary whitespace in MSTestMigrationAnalyzerTes…
thomhurst Oct 12, 2025
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
Prev Previous commit
Next Next commit
fix: add missing diagnostic verifications for MSTest and NUnit migrat…
…ion tests
  • Loading branch information
thomhurst committed Sep 24, 2025
commit 70c484ca8c82e94c3477b1097f15aba6436ca09f
14 changes: 7 additions & 7 deletions TUnit.Analyzers.Tests/MSTestMigrationAnalyzerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class MyClass
public void MyMethod() { }
}
""",
Verifier.Diagnostic(Rules.MSTestMigration).WithLocation(0),
$$"""
using TUnit.Core;
using static TUnit.Assertions.Assert;
Expand All @@ -56,7 +57,6 @@ public class MyClass
public void MyMethod() { }
}
""",
Verifier.Diagnostic(Rules.MSTestMigration).WithLocation(0),
ConfigureMSTestTest
);
}
Expand All @@ -75,6 +75,7 @@ public class MyClass
public void MyMethod() { }
}
""",
Verifier.Diagnostic(Rules.MSTestMigration).WithLocation(0),
"""
using TUnit.Core;
using static TUnit.Assertions.Assert;
Expand All @@ -86,7 +87,6 @@ public class MyClass
public void MyMethod() { }
}
""",
Verifier.Diagnostic(Rules.MSTestMigration).WithLocation(0),
ConfigureMSTestTest
);
}
Expand All @@ -110,6 +110,7 @@ public void MyMethod()
}
}
""",
Verifier.Diagnostic(Rules.MSTestMigration).WithLocation(0),
"""
using TUnit.Core;
using static TUnit.Assertions.Assert;
Expand All @@ -127,7 +128,6 @@ public void MyMethod()
}
}
""",
Verifier.Diagnostic(Rules.MSTestMigration).WithLocation(0),
ConfigureMSTestTest
);
}
Expand Down Expand Up @@ -161,6 +161,7 @@ public class MyClass
public void MyMethod() { }
}
""",
Verifier.Diagnostic(Rules.MSTestMigration).WithLocation(0),
"""
using TUnit.Core;
using static TUnit.Assertions.Assert;
Expand All @@ -171,7 +172,6 @@ public class MyClass
public void MyMethod() { }
}
""",
Verifier.Diagnostic(Rules.MSTestMigration).WithLocation(0),
ConfigureMSTestTest
);
}
Expand All @@ -195,6 +195,7 @@ public void Teardown() { }
public void MyMethod() { }
}
""",
Verifier.Diagnostic(Rules.MSTestMigration).WithLocation(0),
"""
using TUnit.Core;
using static TUnit.Assertions.Assert;
Expand All @@ -212,7 +213,6 @@ public void Teardown() { }
public void MyMethod() { }
}
""",
Verifier.Diagnostic(Rules.MSTestMigration).WithLocation(0),
ConfigureMSTestTest
);
}
Expand All @@ -236,6 +236,7 @@ public static void ClassTeardown() { }
public void MyMethod() { }
}
""",
Verifier.Diagnostic(Rules.MSTestMigration).WithLocation(0),
"""
using TUnit.Core;
using static TUnit.Assertions.Assert;
Expand All @@ -253,7 +254,6 @@ public static void ClassTeardown() { }
public void MyMethod() { }
}
""",
Verifier.Diagnostic(Rules.MSTestMigration).WithLocation(0),
ConfigureMSTestTest
);
}
Expand All @@ -277,6 +277,7 @@ public void MyMethod()
}
}
""",
Verifier.Diagnostic(Rules.MSTestMigration).WithLocation(0),
"""
using TUnit.Core;
using static TUnit.Assertions.Assert;
Expand All @@ -294,7 +295,6 @@ public void MyMethod()
}
}
""",
Verifier.Diagnostic(Rules.MSTestMigration).WithLocation(0),
ConfigureMSTestTest
);
}
Expand Down
12 changes: 6 additions & 6 deletions TUnit.Analyzers.Tests/NUnitMigrationAnalyzerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class MyClass
public void MyMethod() { }
}
""",
Verifier.Diagnostic(Rules.NUnitMigration).WithLocation(0),
$$"""
using TUnit.Core;
using static TUnit.Assertions.Assert;
Expand All @@ -58,7 +59,6 @@ public class MyClass
public void MyMethod() { }
}
""",
Verifier.Diagnostic(Rules.NUnitMigration).WithLocation(0),
ConfigureNUnitTest
);
}
Expand All @@ -77,6 +77,7 @@ public class MyClass
public void MyMethod() { }
}
""",
Verifier.Diagnostic(Rules.NUnitMigration).WithLocation(0),
"""
using TUnit.Core;
using static TUnit.Assertions.Assert;
Expand All @@ -88,7 +89,6 @@ public class MyClass
public void MyMethod() { }
}
""",
Verifier.Diagnostic(Rules.NUnitMigration).WithLocation(0),
ConfigureNUnitTest
);
}
Expand All @@ -111,6 +111,7 @@ public void MyMethod()
}
}
""",
Verifier.Diagnostic(Rules.NUnitMigration).WithLocation(0),
"""
using TUnit.Core;
using static TUnit.Assertions.Assert;
Expand All @@ -127,7 +128,6 @@ public void MyMethod()
}
}
""",
Verifier.Diagnostic(Rules.NUnitMigration).WithLocation(0),
ConfigureNUnitTest
);
}
Expand All @@ -151,6 +151,7 @@ public void MyMethod()
}
}
""",
Verifier.Diagnostic(Rules.NUnitMigration).WithLocation(0),
"""
using TUnit.Core;
using static TUnit.Assertions.Assert;
Expand All @@ -168,7 +169,6 @@ public void MyMethod()
}
}
""",
Verifier.Diagnostic(Rules.NUnitMigration).WithLocation(0),
ConfigureNUnitTest
);
}
Expand Down Expand Up @@ -202,6 +202,7 @@ public class MyClass
public void MyMethod() { }
}
""",
Verifier.Diagnostic(Rules.NUnitMigration).WithLocation(0),
"""
using TUnit.Core;
using static TUnit.Assertions.Assert;
Expand All @@ -212,7 +213,6 @@ public class MyClass
public void MyMethod() { }
}
""",
Verifier.Diagnostic(Rules.NUnitMigration).WithLocation(0),
ConfigureNUnitTest
);
}
Expand All @@ -236,6 +236,7 @@ public void Teardown() { }
public void MyMethod() { }
}
""",
Verifier.Diagnostic(Rules.NUnitMigration).WithLocation(0),
"""
using TUnit.Core;
using static TUnit.Assertions.Assert;
Expand All @@ -253,7 +254,6 @@ public void Teardown() { }
public void MyMethod() { }
}
""",
Verifier.Diagnostic(Rules.NUnitMigration).WithLocation(0),
ConfigureNUnitTest
);
}
Expand Down
4 changes: 4 additions & 0 deletions TUnit.Analyzers.Tests/TUnit.Analyzers.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" VersionOverride="4.8.0" />
<PackageReference Include="Microsoft.Testing.Extensions.HangDump" />
<PackageReference Include="Polly" />
<PackageReference Include="MSTest.TestFramework" />
<PackageReference Include="NUnit" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TUnit.Analyzers.CodeFixers\TUnit.Analyzers.CodeFixers.csproj" />
<ProjectReference Include="..\TUnit.Engine\TUnit.Engine.csproj" />
<ProjectReference Include="..\TUnit.Analyzers\TUnit.Analyzers.csproj" />
<ProjectReference Include="..\TUnit.TestProject.Library\TUnit.TestProject.Library.csproj" />
<ProjectReference Include="..\TUnit.Core\TUnit.Core.csproj" />
<ProjectReference Include="..\TUnit.Assertions\TUnit.Assertions.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
Expand Down
Loading