Reputation:
How to Make a test method not runnable in Visual Studio Unit Test ? using visual studio 2010 with .NET 4.0.
Suppose I have 10 test methods out of which, 1 test method is not working due to external dependencies. If I want to run all 10, then I will get error in one test.
One solution is: Don't run the test. But I need to know, is there any Attributes or anything like that, which simply bypasses the test and it will not be run.
I tried with [WorkItem(1234)]
Attribute, but still the test is running.
Any help is greatly appreciated.
Upvotes: 9
Views: 6690
Reputation: 8147
Yes, you can add the Ignore
attribute to the test you want to skip:
[TestMethod, Ignore]
public void ThisTestWontRun()
{
// Test code here
}
Upvotes: 29