I've recently starting using VS2013 (was previously using 2010).
I no longer seem to be able to run ignored tests by either using Resharper or the Visual Studio test runner. This is how I am declaring test methods:
[TestMethod, Ignore]
public void TestMethod()
{
// Do something
}
I used to be able to previously run tests like this manually? Has this functionality been removed?
NUnit's Explicit attribute still works fine.
Thanks
Because the compile makes the ignore part of the source code you cannot run tests that have been ignored from the MSTest test runner. If you want to have conditionally executed tests, you have a few options.
Create a new build configuration, and set a compiler directive. Include the ignore unless/only when the directive is set (depending on your usage)
Disable the tests, but do not "ignore" them. Disabling means the test can be manually run, ignoring means they cannot.
Create a new "ignored" test category, and exclude that from your builds/other testing runs. Then just include that category locally.
Hopefully one of these three would work for you. Kind of depends on what your setup is, and the reasons you are ignoring/not ignoring these tests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With