From 3e7eb6df6189c6d3f93a28cef9ab34b735b86ab0 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 22 Oct 2015 10:28:20 -0700 Subject: [PATCH] Skip auto generated files from API consistency --- .../ApiConsistencyTestBase.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.Tests/ApiConsistencyTestBase.cs b/test/Microsoft.AspNet.Diagnostics.Entity.Tests/ApiConsistencyTestBase.cs index 7bf037ae83..f5e7214453 100644 --- a/test/Microsoft.AspNet.Diagnostics.Entity.Tests/ApiConsistencyTestBase.cs +++ b/test/Microsoft.AspNet.Diagnostics.Entity.Tests/ApiConsistencyTestBase.cs @@ -7,12 +7,18 @@ using System.Linq; using System.Reflection; using System.Threading; using System.Threading.Tasks; +using Microsoft.AspNet.Diagnostics.Entity.Views; using Xunit; namespace Microsoft.Data.Entity { public abstract class ApiConsistencyTestBase { + private static readonly HashSet _typesToSkip = new HashSet + { + typeof(DatabaseErrorPage) + }; + protected const BindingFlags PublicInstance = BindingFlags.Instance | BindingFlags.Public; @@ -29,6 +35,7 @@ namespace Microsoft.Data.Entity && type.GetConstructors(AnyInstance).Any(c => c.IsPublic || c.IsFamily || c.IsFamilyOrAssembly) && type.Namespace != null && !type.Namespace.EndsWith(".Compiled") + && !_typesToSkip.Contains(type) from method in type.GetMethods(PublicInstance) where method.DeclaringType == type && !(method.IsVirtual && !method.IsFinal) @@ -45,7 +52,7 @@ namespace Microsoft.Data.Entity { var parametersMissingAttribute = (from type in GetAllTypes(TargetAssembly.GetTypes()) - where type.IsVisible && !typeof(Delegate).IsAssignableFrom(type) + where type.IsVisible && !typeof(Delegate).IsAssignableFrom(type) && !_typesToSkip.Contains(type) let interfaceMappings = type.GetInterfaces().Select(type.GetInterfaceMap) let events = type.GetEvents() from method in type.GetMethods(PublicInstance | BindingFlags.Static)