mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-15 13:57:09 +01:00
Add NUnit XML results fixtures
This commit is contained in:
parent
78ed680850
commit
b34d4b1bfe
6 changed files with 327 additions and 0 deletions
64
reports/dotnet/DotnetTests.NUnitV3Tests/CalculatorTests.cs
Normal file
64
reports/dotnet/DotnetTests.NUnitV3Tests/CalculatorTests.cs
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
using System;
|
||||
using System.Threading;
|
||||
using DotnetTests.Unit;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace DotnetTests.XUnitTests
|
||||
{
|
||||
public class CalculatorTests
|
||||
{
|
||||
private readonly Calculator _calculator = new Calculator();
|
||||
|
||||
[Test]
|
||||
public void Passing_Test()
|
||||
{
|
||||
Assert.That(_calculator.Sum(1, 1), Is.EqualTo(2));
|
||||
}
|
||||
|
||||
[Test(Description = "Some description")]
|
||||
public void Passing_Test_With_Description()
|
||||
{
|
||||
Assert.That(2, Is.EqualTo(2));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Failing_Test()
|
||||
{
|
||||
Assert.That(_calculator.Sum(1, 1), Is.EqualTo(3));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Exception_In_TargetTest()
|
||||
{
|
||||
_calculator.Div(1, 0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Exception_In_Test()
|
||||
{
|
||||
throw new Exception("Test");
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Timeout(1)]
|
||||
public void Timeout_Test()
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Ignore("Skipped")]
|
||||
public void Skipped_Test()
|
||||
{
|
||||
throw new Exception("Test");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[TestCase(2)]
|
||||
[TestCase(3)]
|
||||
public void Is_Even_Number(int i)
|
||||
{
|
||||
Assert.True(i % 2 == 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NUnit" Version="3.13.2" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DotnetTests.Unit\DotnetTests.Unit.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -9,6 +9,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{BCAC3B31
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotnetTests.XUnitTests", "DotnetTests.XUnitTests\DotnetTests.XUnitTests.csproj", "{F8607EDB-D25D-47AA-8132-38ACA242E845}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotnetTests.NUnitV3Tests", "DotnetTests.NUnitV3Tests\DotnetTests.NUnitV3Tests.csproj", "{81023ED7-56CB-47E9-86C5-9125A0873C55}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
@ -23,12 +25,17 @@ Global
|
|||
{F8607EDB-D25D-47AA-8132-38ACA242E845}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F8607EDB-D25D-47AA-8132-38ACA242E845}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F8607EDB-D25D-47AA-8132-38ACA242E845}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{81023ED7-56CB-47E9-86C5-9125A0873C55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{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
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{F8607EDB-D25D-47AA-8132-38ACA242E845} = {BCAC3B31-ADB1-4221-9D5B-182EE868648C}
|
||||
{81023ED7-56CB-47E9-86C5-9125A0873C55} = {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