From 04011aeac36ca4058f9caeca50a19bcdfe36e20d Mon Sep 17 00:00:00 2001 From: Randy-Ma Date: Tue, 21 Mar 2017 10:08:53 +0800 Subject: [PATCH] Ignore test cases which have ignore attributes --- src/Framework/Runner/AssemblyLoader.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Framework/Runner/AssemblyLoader.cs b/src/Framework/Runner/AssemblyLoader.cs index 00282e05..d8b15139 100644 --- a/src/Framework/Runner/AssemblyLoader.cs +++ b/src/Framework/Runner/AssemblyLoader.cs @@ -91,6 +91,13 @@ public static bool ReadTest(MethodInfo test, IFixtureData data, string workingDi var testAttribs = CustomAttributeData.GetCustomAttributes(test); + var ignoreAttrib = + testAttribs.FirstOrDefault(x => x.Constructor.DeclaringType.Name == "IgnoreAttribute"); + if (ignoreAttrib != null) + { + return false; + } + var testModelAttrib = testAttribs.FirstOrDefault(x => x.Constructor.DeclaringType.Name == "TestModelAttribute");