Issafalcon / neotest-dotnet

Neotest adapter for dotnet
MIT License
73 stars 29 forks source link

xUnit: Does not work with trait-attribute #96

Closed wingi11 closed 7 months ago

wingi11 commented 8 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);
    }
}