When a test fails due, for example, to infrastructure issues, you might want to ignore it temporarily. But without some kind of notation about why the test is being ignored, it may never be reactivated. Such tests are difficult to address without comprehensive knowledge of the project, and end up polluting their projects.
This rule raises an issue for each ignored test that does not have a WorkItem attribute nor a comment about why it is being skipped on
the right side of the Ignore attribute.
[TestMethod]
[Ignore]
public void Test_DoTheThing()
{
// ...
}
[TestMethod]
[Ignore] // renable when TCKT-1234 is fixed
public void Test_DoTheThing()
{
// ...
}
or
[TestMethod]
[Ignore]
[WorkItem(1234)]
public void Test_DoTheThing()
{
// ...
}
The rule doesn’t raise an issue if:
WorkItem attribute Ignore attribute