mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-16 14:27:10 +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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue