NUnit TestFixtureSource tests aren't showing up properly in the test runner

Parameterized NUnit TestFixtures are handled properly in ReSharpers test runner.

But when using parameterized TestFixtures via TestFixtureSource the entire test fixture simply shows as one test.

From what I can tell, the tests are still executed correctly. However, because the test runner can't recognise the individual tests, long running Selenium tests will cause the runner to give you a prompt saying "All unit tests finished, but test process still running. Abort?"

Any ideas of how to solve this? The tests run just fine with nunit3-console.exe, and as such work just fine in our automated run.

But not being able to run the properly in VisualStudio is rather frustrating.

Bellow is a simple example to illustrate what I mean.

This is running on the latest NUnit with the latest Resharper btw.

{code}

namespace Sandbox
{
using System.Collections;

using NUnit.Framework;

[TestFixture("a")]
[TestFixture("b")]
public class Tests
{
private readonly string input;

public Tests(string input)
{
this.input = input;
}

[Test]
public void Test()
{
TestContext.WriteLine(this.input);
}
}

[TestFixtureSource(typeof(SourceClass))]
public class Tests2
{
private readonly string input;

public Tests2(string input)
{
this.input = input;
}

[Test]
public void Test()
{
TestContext.WriteLine(this.input);
}
}

public class SourceClass : IEnumerable
{
public IEnumerator GetEnumerator()
{
yield return "a";
yield return "b";
}
}
}

{code}

3 comments
Comment actions Permalink
Official comment

Hello Johan!

 

Thank you for contacting us.

Please feel free to comment or vote for corresponding issue - https://youtrack.jetbrains.com/issue/RSRP-459691

Thank you.

Comment actions Permalink

Same issue on my side. Tests are running, I can debug them but it's hard to know what's happening without any feedback in the test runner.

1
Comment actions Permalink

Same thing happening, tests run just fine from CLI (`dotnet test`), but trying to run them from VS results in R# going a bit bonkers and marking the tests as inconclusive. Any idea on how to fix this?

1

Please sign in to leave a comment.