Skip to content

Instantly share code, notes, and snippets.

@mookid8000
Created February 3, 2012 11:20
Show Gist options
  • Save mookid8000/1729732 to your computer and use it in GitHub Desktop.
Save mookid8000/1729732 to your computer and use it in GitHub Desktop.
AssertIgnorance()
[Test]
public void AssertIgnorance()
{
var ignoredTestCases = Assembly.GetExecutingAssembly().GetTypes()
.SelectMany(t => t.GetMethods())
.Where(m => m.GetCustomAttributes(typeof (IgnoreAttribute), false).Any())
.ToList();
Assert.That(ignoredTestCases.Any(), Is.False, @"The following tests have been IGNORED:
{0}", string.Join(Environment.NewLine, ignoredTestCases.Select(m => " " + m.DeclaringType + ": " + m).ToArray()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment