machine.specifications icon indicating copy to clipboard operation
machine.specifications copied to clipboard

R# Test Runner - Tests Go Missing

Open tapmantwo opened this issue 11 years ago • 3 comments

We've experienced scenarios where tests disappear from the Test Session window. Upon investigation, it seems to happen if you have tests that inherit from some other test class, and both have a Subject attribute applied.

A simple reproduction would be as follows;

namespace MSpecInheritance
{
    [Subject("Some base stuff")]
    public class BaseTestClass
    {        
    }

    [Subject("Some maths")]
    public class DerivedTestClass : BaseTestClass
    {
        private static int _start;
        private static int _result;
        Establish we_have_a_starting_value_of_10 = () =>
        {
            _start = 10;
        };

        private Because we_add_5 = () => _result = _start + 5;

        private It should_equal_15 = () => _result.ShouldEqual(15);
    }
}

The command line runner seems fine.

tapmantwo avatar Mar 20 '15 15:03 tapmantwo

i think this is a duplicate of #218 #221 and maybe #228

BrunoJuchli avatar Jul 01 '15 18:07 BrunoJuchli

This bug is going to appear with every R# release again. I fixed it some time ago for R# v8, but the bug appeared again with newer versions. The subject is part of the Unit Test Element Identification of the R# runner. Tests with subjects on inherited classes disappear abruptly, because R# thinks that the subject and therefore the test changed for some reason. I just now removed all subjects on inherited classes, to be able to run single tests in the source code directly and to use the unit test session again.

Is anyone working on this? otherwise I'm gonna try to fix it.

FabianTrottmann avatar Jul 22 '15 14:07 FabianTrottmann

I'm not working on it.Don't know about anyone else but i don't think so.

BrunoJuchli avatar Jul 22 '15 16:07 BrunoJuchli