Reputation: 2700
Is it possible to provide an explicative message in the Ignore decorator to a unit test in C#, like this?
[TestMethod]
[Ignore("This is intended to work locally only because lack of permissions")]
public void TestStartAcquireIfEmpty()
{
}
So that in case a future development is done, this decorator can be removed from the unit test
Upvotes: 2
Views: 4299
Reputation: 143243
Three of the most popular .NET test frameworks allow to mark test as ignored and provide ignore reason:
IgnoreAttribute
has constructor accepting message
parameterIgnoreAttribute
has constructor accepting reason
parameterSkip
property (which is of string type) to ignore testUpvotes: 2
Reputation: 38179
You could add this line as the first line of your test:
Assert.Inconclusive("This is intended to work locally only because lack of permissions");
The test result will be shown as inconclusive with this message.
Upvotes: 2