MSTest Run Ignored Tests (VS2013)

I recently started using VS2013 (previously used 2010).

I can no longer run ignored tests using either Resharper or Visual Studio tester. This is how I declare test methods:

[TestMethod, Ignore] public void TestMethod() { // Do something } 

Could I run tests like this manually before? Is this feature removed?

NUnit The explicit attribute is still working fine.

thanks

+6
source share
1 answer

Since the compiler does the part of ignoring the source code, you cannot run tests that were ignored from the MSTest test runner. If you want to have conditionally executed tests, you have several options.

  • Create a new build configuration and set the compiler directive. Enable ignore if / only when directive is set (depending on your use)

  • Disable tests, but do not ignore them. Disabling means that the test can be started manually, ignoring that they cannot.

  • Create a new "ignored" category of tests and exclude this from your builds / other tests. Then just enable this category locally.

Hopefully one of these three will work for you. The view depends on what you have and the reasons why you ignore or do not ignore these tests.

+3
source

Source: https://habr.com/ru/post/978309/


All Articles