1

Closed

Test methods in base classes not running properly

description

I know that this was stated in the release but wasn't sure on the specifics..

You used to be able to inherit from a base class that had tests defined and it would run all the tests in the base class and the inherited class (and/or show them).

Is there a work around for this? This worked in Resharper 5 with the associated plugin. Or is there a better design pattern to use for tests then base classes? I essentially have a set of tests that need to be run on a group of plugins. So there are tests that need to be run on all plugins but then there could be specific tests per plugin.
Closed Nov 28, 2011 at 10:51 PM by mattellis
Released in xunitcontrib-resharper 0.5

comments

mthamilton wrote Jul 12, 2011 at 6:10 PM

Could you use a Theory to run the same test on multiple plugins?

mattellis wrote Nov 14, 2011 at 7:42 PM

Fixed in changeset 4881cd57e614

TripleEmcoder wrote Nov 27, 2011 at 1:30 PM

I tried this fix with today's 6.1 EAP and the result is that inherited tests do show up in unit test explorer, but when I add one of them to a new session and run it, instead the child class is being run (the icon spins next to the class name, test icon remains forever gray), all of the inherited tests are actually being run behind the scenes and all results are being ignored - the child class shows as succeded, even though there were failures. Also, no Debug.WriteLine is redirected to the Output window. Test failures show up in the ReSharper unexpected exception handler.

hazzik wrote Nov 28, 2011 at 1:02 AM

mattellis wrote Nov 28, 2011 at 12:15 PM

Yeah, the 4881... changeset has a bug in the base class support. It's fixed locally, but I need to push.

TripleEmcoder wrote Nov 28, 2011 at 12:40 PM

@hazzik Brilliant! I didn't know a different runner existed. Everything works as expected.

mattellis wrote Nov 28, 2011 at 10:09 PM

Fixed in changeset 981555d99932