Skip to content

Instantly share code, notes, and snippets.

@juanplopes
Forked from ElemarJR/test.cs
Created April 18, 2011 16:19
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 juanplopes/925639 to your computer and use it in GitHub Desktop.
Save juanplopes/925639 to your computer and use it in GitHub Desktop.
[Test]
public static void Class_AllStaticMethodsShouldBeDecoratedWithDebuggerStepThroughAttribute()
{
var methods = StaticMethodsWithout(typeof(Mooble.Util.StringExtensions), typeof(DebuggerStepThroughAttribute))
methods.Count.Should.Be(0);
}
IEnumerable<MethodInfo> StaticMethodsWithout(Type type, Type attribute)
{
return from m in type.GetMethods()
where !m.IsSpecialName && m.IsStatic &&
m.GetCustomAttributes(attribute, true).Count() == 0
select m.Name;
}
@allanssnet
Copy link

Esta ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment