Skip to content

Instantly share code, notes, and snippets.

@ElemarJR
Created April 18, 2011 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ElemarJR/925632 to your computer and use it in GitHub Desktop.
Save ElemarJR/925632 to your computer and use it in GitHub Desktop.
[Test]
public static void Class_AllStaticMethodsShouldBeDecoratedWithDebuggerStepThroughAttribute()
{
var methods = from m in typeof(Mooble.Util.StringExtensions).GetMethods()
where !m.IsSpecialName && m.IsStatic &&
m.GetCustomAttributes(typeof(DebuggerStepThroughAttribute), true).Count() == 0
select m.Name;
if (methods.Count() > 0)
{
var list = methods.Aggregate((first, second) => first + ", " + second);
Assert.Fail("Some methods (" + list + ") should be decorated with DebuggerStepThroughAttribute");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment