We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3b0b54 commit 949f465Copy full SHA for 949f465
LibGit2Sharp.Tests/MetaFixture.cs
@@ -307,6 +307,7 @@ public void NoOptionalParametersinMethods()
307
from t in Assembly.GetAssembly(typeof(IRepository))
308
.GetExportedTypes()
309
from m in t.GetMethods()
310
+ where !m.IsObsolete()
311
from p in m.GetParameters()
312
where p.IsOptional
313
select m.DeclaringType + "." + m.Name;
@@ -344,4 +345,13 @@ where p.IsOptional
344
345
Assert.Equal("", sb.ToString());
346
}
347
348
+
349
+ internal static class TypeExtensions
350
+ {
351
+ internal static bool IsObsolete(this MethodInfo methodInfo)
352
353
+ var attributes = methodInfo.GetCustomAttributes(false);
354
+ return attributes.Any(a => a is ObsoleteAttribute);
355
+ }
356
357
0 commit comments