Unit test runner - spurious tests shown when using TestCase attribute

Answered

Visual Studio 2013 with Update 5
Windows 8.1 64-bit
Resharper 10.0.2
NUnit 3.0.1

The ReSharper test runner shows a spurious unit test when a test method is decorated with the TestCase attribute.
Here is a simple unit test:

using NUnit.Framework;


namespace Nunit3AndReSharper10
{
    [TestFixture]
    public class Class1
    {
        [Test]
        [TestCase(@"12345678901234567890123456789012345678901")]
        public void ExtractingInformationFromFileNames(string file)
        {
            Assert.Inconclusive("No code!");
        }
    }
}


See the attached screen-shot. It shows the runner's view of this single test.  The runner erroneously constructs two tests from this single test.  The first (correctly marked as inconclusive - see the body of the test method) is incorrectly named.  The name has been truncated and ends with an elipsis.  The second test is marked as pending, but the name of the test is correct.  The Orange text on the right hand side of the session window is inconsistent when this spurious test is visible.  It states "Test not run".  The single test HAS been run and has been found to be inconclusive.  The spurious test (marked as Pending) causes the erroneous statement "Test not run" to be shown.

This appears to be a bug in the test runner.  I have experimented with the runner and found the following:
If the length of the string within the TestCase attribute is 41 characters or greater, the spurious test is shown.
If the length of the string is 40 characters or less, the spurious test is not shown.





Attachment(s):
SpuriousTest.png
1 comment
Comment actions Permalink
Official comment

Hello David,

There is a similar issue in YouTrack https://youtrack.jetbrains.com/issue/RSRP-452867. You are welcome to follow it.

Thanks! 

Please sign in to leave a comment.