nunit: NUnit 4.0 fails when [Repeat] is present and test passes

Trying out the new v4 preview on my test suites, I got the following issue

This passing test does not appear in the test results:

public class Tests
{
    [Test]
    [Repeat(30)]
    public void Test1()
    {
        bool x = true;
        Assert.That(x, Is.True);
    }
}

Running dotnet test yields

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
No test is available in C:\Users\rende\source\repos\NUnitRepro\NUnitRepro\bin\Debug\net7.0\NUnitRepro.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.

whereas the test

public class Tests
{
    [Test]
    [Repeat(30)]
    public void Test1()
    {
        bool x = true;
        Assert.That(x, Is.False);
    }
}

yields

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
  Failed Test1 [26 ms]
  Error Message:
     Assert.That(x, Is.False)
  Expected: False
  But was:  True

  Stack Trace:
     at Tests.Test1() in C:\Users\rende\source\repos\NUnitRepro\NUnitRepro\UnitTest1.cs:line 8

1)    at Tests.Test1() in C:\Users\rende\source\repos\NUnitRepro\NUnitRepro\UnitTest1.cs:line 8



Failed!  - Failed:     1, Passed:     0, Skipped:     0, Total:     1, Duration: 26 ms - NUnitRepro.dll (net7.0)

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Comments: 24

Most upvoted comments