resharperxunit.netmspec

ReSharper doesn't see my Machine.Specification tests


I'm having a problem getting ReSharper to see the Machine.Specification "tests" I've written.

The specs run in the ConsoleRunner from mSpec. When I try to "Run Unit Tests" in ReSharper, I get a message: "No tests found in file." The specs don't show the test markers.

I created a folder in the ReSharper /bin/ folder and put the proper .dlls there. The mSpec plug in appears in ReSharper.

What might I be missing?

Also, I'm using xUnit.NET if that makes a difference.


Solution

  • The ReSharper runner do not take nested context classes into account. Instead of nesting context classes:

    namespace SomeNamespace
    {
        public class Specs
        {
            public class when_something_happens
            {
                Because of = () => {};
                It should_do_something = () => {};
            }
        }
    }
    

    Author contexts that are not nested, i.e. root classes inside a namespace:

    namespace SomeNamespace
    {
        public class when_something_happens
        {
            Because of = () => {};
            It should_do_something = () => {};
        }
    }
    

    ReSharper's green-and-yellow test icons do appear if all of the conditions are met: