26

I remember something like 'explicit', and google says that nunit has such attribute. Does Microsoft.VisualStudio.TestTools.UnitTesting provide something like this?

1
  • 1
    Also as an option is to create 2 test projects - 1 for one-time tests and 1 for regular tests Commented Feb 8, 2010 at 17:49

3 Answers 3

11

The MSTest tools does not explicitly support this type of behavior at an attribute level. At the attribute level you can either enable a test via the TestMethod attribute or completely disable it with the Ignore attribute. Once the Ignore attribute is added, mstest will not run the test until it is removed. You cannot override this behavior via the UI.

What you can do though is disable the test via the property page. Open up the test list editor, select the test you want and hit F4 to bring up the property page. Set the Test Enabled property to false. The test will now not run until you re-enable it through the property page. It's not exactly what you're looking for but likely the closest equivalent.

Sign up to request clarification or add additional context in comments.

4 Comments

Do you know, where this is stored? .csproj or .suo?
@Sergey, I do not know but my guess is the .suo file
@Sergey: this Test Enabled property is stored in a solution-level .vsmdi file
it stores information in SolutionName.vsmdi (Microsoft Visual Studio test meta data file) and in this way all developers can have same settings using svn.
4

You can create a "Run Manually" category for your tests using the Category attribute, and then exclude that category from your tests in the GUI. These tests will be grayed out, and you can put them back in whenever you want. I do this often for slow-running tests.

Comments

0

I haven't used it, and it looks pretty old (Mar 2008), but I see that TestListGenerator claims to auto-generate Test Lists based on attributes you set on your tests. If it works, this would effectively provide Categories for MS Test. While not the same as Explicit, it may let you achieve what you want.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.