-
Notifications
You must be signed in to change notification settings - Fork 291
Description
Describe the bug
I've been tasked to upgrade multiple of our projects from MsTest 3.x to 4.x. In doing so, i upgrade Package Version in steps, ie: 3.9.* -> 3.10.* -> 3.11 [-> 4.* where applicable].
The new Analyzers/CodeFixes are not implemented with enough care. A "fix all in solution" results in widespread ugly code.
Steps To Reproduce
- include a version with Analyzer+Codefix for MSTEST0037
[TestClass]
public sealed class Test1
{
[TestMethod]
public void TestMethod1()
{
List<int> numbers = [1, 2, 3];
Assert.IsTrue(numbers.Contains(2),
"list has wrong count");
}
}Expected behavior
namespace TestProject1;
[TestClass]
public sealed class Test1
{
[TestMethod]
public void TestMethod1()
{
List<int> numbers = [1, 2, 3];
Assert.Contains(2, numbers,
"list has wrong count");
}
}Actual behavior
[TestClass]
public sealed class Test1
{
[TestMethod]
public void TestMethod1()
{
List<int> numbers = [1, 2, 3];
Assert.Contains(2,
numbers, "list has wrong count");
}
}Additional context
this bugfix should be backported to 3.x to ease migration