mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-15 13:57:09 +01:00
Add test on a trx report where the className attribute of TestMethod is missing
This reproduces issue #556
This commit is contained in:
parent
18430db883
commit
d1504ea554
11 changed files with 131 additions and 20 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<DeterministicSourcePaths>true</DeterministicSourcePaths>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -1,16 +1,14 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<DeterministicSourcePaths>true</DeterministicSourcePaths>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.0" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
|
||||
<PackageReference Include="coverlet.collector" Version="1.2.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
|
||||
<PackageReference Include="xunit" Version="2.9.3" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<OutputType>exe</OutputType>
|
||||
<DeterministicSourcePaths>true</DeterministicSourcePaths>
|
||||
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="1.7.3" />
|
||||
<PackageReference Include="xunit.v3" Version="2.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
27
reports/dotnet/DotnetTests.XUnitV3Tests/FixtureTests.cs
Normal file
27
reports/dotnet/DotnetTests.XUnitV3Tests/FixtureTests.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using Xunit;
|
||||
|
||||
namespace DotnetTests.XUnitV3Tests;
|
||||
|
||||
public sealed class Fixture : IDisposable
|
||||
{
|
||||
public void Dispose()
|
||||
{
|
||||
throw new InvalidOperationException("Failure during fixture disposal");
|
||||
}
|
||||
}
|
||||
|
||||
public class FixtureTests(Fixture fixture) : IClassFixture<Fixture>
|
||||
{
|
||||
[Fact]
|
||||
public void Passing_Test()
|
||||
{
|
||||
Assert.NotNull(fixture);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Failing_Test()
|
||||
{
|
||||
Assert.Null(fixture);
|
||||
}
|
||||
}
|
||||
|
|
@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotnetTests.XUnitTests", "D
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotnetTests.NUnitV3Tests", "DotnetTests.NUnitV3Tests\DotnetTests.NUnitV3Tests.csproj", "{81023ED7-56CB-47E9-86C5-9125A0873C55}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotnetTests.XUnitV3Tests", "DotnetTests.XUnitV3Tests\DotnetTests.XUnitV3Tests.csproj", "{D35E65DC-62EF-4612-9FF3-66F5600BFB74}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
@ -29,6 +31,10 @@ Global
|
|||
{81023ED7-56CB-47E9-86C5-9125A0873C55}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{81023ED7-56CB-47E9-86C5-9125A0873C55}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{81023ED7-56CB-47E9-86C5-9125A0873C55}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D35E65DC-62EF-4612-9FF3-66F5600BFB74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D35E65DC-62EF-4612-9FF3-66F5600BFB74}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D35E65DC-62EF-4612-9FF3-66F5600BFB74}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D35E65DC-62EF-4612-9FF3-66F5600BFB74}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
@ -36,6 +42,7 @@ Global
|
|||
GlobalSection(NestedProjects) = preSolution
|
||||
{F8607EDB-D25D-47AA-8132-38ACA242E845} = {BCAC3B31-ADB1-4221-9D5B-182EE868648C}
|
||||
{81023ED7-56CB-47E9-86C5-9125A0873C55} = {BCAC3B31-ADB1-4221-9D5B-182EE868648C}
|
||||
{D35E65DC-62EF-4612-9FF3-66F5600BFB74} = {BCAC3B31-ADB1-4221-9D5B-182EE868648C}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {6ED5543C-74AA-4B21-8050-943550F3F66E}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue