Add test on a trx report where the className attribute of TestMethod is missing

This reproduces issue #556
This commit is contained in:
Cédric Luthi 2025-06-22 16:18:52 +02:00
parent 18430db883
commit d1504ea554
11 changed files with 131 additions and 20 deletions

View file

@ -40,7 +40,7 @@ namespace DotnetTests.XUnitTests
}
[Test]
[Timeout(1)]
[CancelAfter(1)]
public void Timeout_Test()
{
Thread.Sleep(100);
@ -58,7 +58,7 @@ namespace DotnetTests.XUnitTests
[TestCase(3)]
public void Is_Even_Number(int i)
{
Assert.True(i % 2 == 0);
Assert.That(i % 2 == 0);
}
}
}

View file

@ -1,14 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsPackable>false</IsPackable>
<TargetFramework>net8.0</TargetFramework>
<DeterministicSourcePaths>true</DeterministicSourcePaths>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="NUnit" Version="4.3.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
</ItemGroup>
<ItemGroup>