-
-
Notifications
You must be signed in to change notification settings - Fork 114
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
When running the TUnit NUnit migration code fixer using dotnet format analyzers --severity info --diagnostics TUNU0001, the using NUnit.Framework; statements are not removed from the migrated files, even though TUnit usings are added.
Steps to Reproduce
- Create a project with NUnit tests
- Add TUnit packages
- Run
dotnet format analyzers --severity info --diagnostics TUNU0001 - Build the project
Expected Behavior
The using NUnit.Framework; statements should be removed after migration since NUnit is no longer used.
Actual Behavior
The NUnit using statements remain, causing build errors when NUnit packages are removed:
error CS0246: The type or namespace name 'NUnit' could not be found
Example
Before migration:
using NUnit.Framework;
[TestFixture]
public class MyTests
{
[Test]
public void MyTest()
{
Assert.IsNotNull(someValue);
}
}After migration (current):
using System.Threading.Tasks;
using TUnit.Core;
using TUnit.Assertions;
using static TUnit.Assertions.Assert;
using TUnit.Assertions.Extensions;
// ... license header ...
using NUnit.Framework; // <-- Still present
public class MyTests
{
[Test]
public async Task MyTest()
{
await Assert.That(someValue).IsNotNull();
}
}Expected after migration:
using System.Threading.Tasks;
using TUnit.Core;
using TUnit.Assertions;
using static TUnit.Assertions.Assert;
using TUnit.Assertions.Extensions;
// ... license header ...
// No NUnit using statement
public class MyTests
{
[Test]
public async Task MyTest()
{
await Assert.That(someValue).IsNotNull();
}
}Environment
- TUnit version: 1.9.91
- .NET version: .NET 8.0
- OS: Windows
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working