Skip to content

[Bug]: Nunit migration removes testes code for specific case #4234

@damiand2

Description

@damiand2

Description

When Nunit Assert looks like this:
Assert.ThrowsAsync(Is.TypeOf(typeof(ArgumentException)), async () => await Sut.Execute(10));
autmatic TUnit conversion replaces it with:
await Assert.That(Is.TypeOf(typeof(ArgumentException))).Throws();
which completely removes code that needs to be migrated

Expected Behavior

as above

Actual Behavior

as above

Steps to Reproduce

as above

TUnit Version

1.9.2

.NET Version

10

Operating System

Windows

IDE / Test Runner

dotnet CLI (dotnet test / dotnet run)

Error Output / Stack Trace

Additional Context

No response

IDE-Specific Issue?

  • I've confirmed this issue occurs when running via dotnet test or dotnet run, not just in my IDE

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions