Resharper 5.0 testrunner runs tests that I didn't ask it to run
I have ReSharper 5.0, Visual Studio 2008, and my tests are written using MSTest.
I have hundreds of tests in a project. There's something wrong with my production code that I'm trying to run and it fails, as expected. But what's funny is, when I set a breakpoint and debug, the test runner is executing other tests that I did not select. It's not running all the tests, but it consistently runs 2 other tests every time I debug my test in question.
The problem in the production code was that a variable was null and a foreach loop was trying to iterate a null.开发者_Python百科 Ok... no big deal. BUT horribly hard to debug when there are multiple tests firing off in debug mode.
My code has since been fixed, but I'd love to know what happened so that I can prevent this in the future.
Has anyone ever seen this behavior?
EDIT: The three tests that run all have to do with the same method on the class I'm testing.
I would imagine that the other methods are flagged with the [TestInitialize] and/or [ClassInitialize] and/or [TestCleanup] and or [ClassCleanup] attributes.
If that's not the case, I would create an empty Test Class and add the tests one by one until you can reproduce the behavior. I have not seen this happen using Visual Studio 2008 with ReSharper 5.x.
精彩评论