Skip to content

NUnit Migration: [Ignore] attribute not converted to [Skip] #4338

@thomhurst

Description

@thomhurst

Description

When running the TUnit NUnit migration code fixer, the NUnit [Ignore] attribute is not converted to TUnit's [Skip] attribute.

Steps to Reproduce

  1. Create a project with NUnit tests that use [Ignore] attribute
  2. Add TUnit packages
  3. Run dotnet format analyzers --severity info --diagnostics TUNU0001
  4. Build the project

Expected Behavior

[Ignore("reason")] should be converted to [Skip("reason")]

Actual Behavior

The [Ignore] attribute is left unchanged, causing build errors:

error CS0246: The type or namespace name 'Ignore' could not be found
error CS0246: The type or namespace name 'IgnoreAttribute' could not be found

Example

Before migration:

[Test]
[Ignore("I don't see any simple way of doing this...")]
public void Should_properly_interpret_array_of_objects()
{
    // test code
}

After migration (current):

[Test]
[Ignore("I don't see any simple way of doing this...")]  // <-- Not converted
public async Task Should_properly_interpret_array_of_objects()
{
    // test code
}

Expected after migration:

[Test]
[Skip("I don't see any simple way of doing this...")]
public async Task Should_properly_interpret_array_of_objects()
{
    // test code
}

Environment

  • TUnit version: 1.9.91
  • .NET version: .NET 8.0
  • OS: Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions