question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting [TestCaseSource] to [Explicit] makes other tests in fixture explicit.

See original GitHub issue
public class FooTests
{
    private static readonly TestCaseData[] Values =
    {
        new TestCaseData(1),
        new TestCaseData(2),
    };

    [Explicit("Don't run this")]
    [TestCaseSource(nameof(Values))]
    public void Test1(object value)
    {
    }

    [Test]
    public void Test2()
    {
        Assert.Pass();
    }
}
<TargetFramework>net461</TargetFramework>

Using the R# runner: image

  • NUnit 3.10.1
  • NUnit 3 Test Adapter 3.10.0.0
  • VS 15.8.3
  • Resharper 2018.2.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

Explicit
The Explicit attribute causes a test or test fixture to be skipped unless it is explicitly selected for running. The test or fixture...
Read more >
NUnit - TestCaseSource
TestCaseSourceAttribute is used on a parameterized test method to identify the property, method or field that will provide the required arguments.
Read more >
Set test case source using TextFixtureAttribute
I'd make all methods public static and use them explicitly. class TestHelpers { public static void AssertReflexivity<X>(X x) { bool isEqual ...
Read more >
NUnit set test name programmatically
In the link that you posted, there is a snippet where you explicitly create the TestCaseData objects via a method linked via the ......
Read more >
Re: Struggling with TestCaseSource and TestCaseData ...
I have a working set of unit tests which use a custom TestCaseData entity along with the TestCaseSource attribute to utilize it.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found