Issafalcon / neotest-dotnet

Neotest adapter for dotnet
MIT License
71 stars 26 forks source link

xUnit: Does not work with trait-attribute #96

Closed wingi11 closed 5 months ago

wingi11 commented 6 months ago

If you use the xUnit Trait attribute TraitAttribute.TraitAttribute(string name, string value) the test gets ignored/not found.

Simple XUnit test class to reproduce the issue:

using Xunit;

public class UnitTest1
{
    // This test is not found by neotest
    [Fact]
    [Trait("SomeName", "SomeValue")]
    public void PassingTest()
    {
        Assert.Equal(4, 4);
    }

    // This test is found
    [Fact]
    public void PassingTestNoTrait()
    {
        Assert.Equal(4, 4);
    }
}