Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-288019: Resharper Testrunner running class without [TestFixture]

$
0
0
Reporter Alex Berezoutsky (fergard) Alex Berezoutsky (fergard)
Created Jan 26, 2012 5:55:38 PM
Updated Jan 26, 2012 8:48:08 PM
Resolved Jan 26, 2012 8:48:08 PM
Priority Critical
Type Bug
Fix versions Next Major
State Won't fix
Assignee Victor Kropp (victor.kropp)
Subsystem No subsystem
Affected versions 6.1.1
Fixed in build No Fixed in build
I included a ZIP with a sample.

Environment:

  • Visual Studio 2008 SP1 (9.0.30729.4462)
  • JetBrains ReSharper 6.1 C# Edition / Build 6.1.37.86 on 2011-12-20T20:15:24
  • NUnit 2.4.8

The issue is this:

  • we have a (non-abstract) test base class that defines the tests (methods marked with [Test] attribute) - this is modelled by the "NonAbstractBaseClass.cs" in my sample
  • that base class also has a virtual method which defines some operation (a calculation, basically)
  • the base class **IS NOT** marked with the [TestFixture] attribute - so as far as I understand NUnit, this is **NOT** a test class and it **SHOULD NOT** be executed

  • we have several descendant classes of this test base class that implement various versions of the calculation (but nothing else) - this is modelled by the "ActualTestFixture.cs" class in my sample
  • those descendants are marked with [TestFixture] - so those **ARE** test classes and ought to be executed when testing

The observed behavior I'm seeing (and have been seeing with Resharper 5.1 and this latest build):

  • even though the "NonAbstractBaseClass" clearly has **NO** [TestFixture] on it, Resharper's Testrunner insists on running the tests defined in that class, and those of course fail miserably since the calculation isn't implemented in that class

The EXPECTED behavior would be:

  • since the "NonAbstractBaseClass" clearly has **NO** [TestFixture] on it, Resharper's Testrunner **SHOULD NOT RUN IT** - to be in line with how NUnit on our build server behaves


I also included three screenshots in the "Screenshots" folder of the ZIP file:

  • NonAbstract_BaseClass_Tests_are_run.png: shows how Resharper Testrunner actually attempts to run the test in the base class
  • Abstract_BaseClass_Tests_are_NOT_run.png: shows how Resharper Testrunner rightfully doesn't run the test in the base class when it's abstract
  • NUnit Testrunner.png: shows how NUnit's graphical test runner handles the tests when using the non-abstract base class without the [TestFixture] attribute (a clear difference to how Resharper's testrunner mis-handles the same case)

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>