mirror of
https://github.com/dorny/test-reporter.git
synced 2026-03-22 16:02:13 +01:00
Add nunit-legacy fixture generation code
This commit is contained in:
parent
41662db5ca
commit
96ad96d584
11 changed files with 379 additions and 0 deletions
|
|
@ -0,0 +1,71 @@
|
|||
using MyLibrary;
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
namespace NUnitLegacyTests
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Inconclusive_Test()
|
||||
{
|
||||
Assert.Inconclusive("couldn't run test for some reason");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue