Permalink
Browse files

Do not use tests marked Explcit or Ignored

Also version up

Change-Id: I04b1790560cf9627f0e498d3912d4a620813d795
  • Loading branch information...
1 parent f8cd4a5 commit 0114d079ed87640d280afc383c845a7bdf191e87 @TonyRoussel TonyRoussel committed Aug 10, 2016
Showing with 7 additions and 6 deletions.
  1. +2 −2 GlobalAssemblyInfo.cs
  2. +5 −4 NinjaTurtlesMutation/TestUtils.cs
@@ -30,6 +30,6 @@
[assembly: AssemblyProduct("NinjaTurtlesMutation")]
[assembly: AssemblyCopyright("Copyright © 2016 Tony Roussel")]
-[assembly: AssemblyVersion("1.1.0.3")]
+[assembly: AssemblyVersion("1.1.0.5")]
[assembly: AssemblyInformationalVersion("BETA 1.1")]
-[assembly: AssemblyFileVersion("1.1.0.3")]
+[assembly: AssemblyFileVersion("1.1.0.5")]
@@ -12,6 +12,7 @@ public static class TestUtils
public static class Attributes
{
public static List<string> Tests = new List<string> {"TestAttribute", "TestCaseAttribute"};
+ public static List<string> UnactivatedTests = new List<string> { "IgnoreAttribute", "ExplicitAttribute" };
}
public static class Filtering
@@ -28,15 +29,15 @@ public static class NUnit
{
var methodsWithAttributes = new Dictionary<string, string>();
foreach (var type in assembly.MainModule.Types)
- GetMethodsNameWithAttributesFromType(type, Attributes.Tests, methodsWithAttributes);
+ GetMethodsNameWithAttributesFromType(type, Attributes.Tests, Attributes.UnactivatedTests, methodsWithAttributes);
return methodsWithAttributes;
}
- private static void GetMethodsNameWithAttributesFromType(TypeDefinition type, IList<string> searchedAttributes, IDictionary<string, string> matchingMethods)
+ private static void GetMethodsNameWithAttributesFromType(TypeDefinition type, IList<string> searchedAttributes, IList<string> avoidedAttributes, IDictionary<string, string> matchingMethods)
{
foreach (var method in type.Methods)
{
- if (!MethodHasAttributes(method, searchedAttributes))
+ if (!MethodHasAttributes(method, searchedAttributes) || MethodHasAttributes(method, avoidedAttributes))
continue;
var methodName = method.Name;
var methodNunitName = String.Format("{0}.{1}", type.FullName.Replace("/", "+"), methodName);
@@ -47,7 +48,7 @@ private static void GetMethodsNameWithAttributesFromType(TypeDefinition type, IL
if (type.NestedTypes == null)
return;
foreach (var nestedType in type.NestedTypes)
- GetMethodsNameWithAttributesFromType(nestedType, searchedAttributes, matchingMethods);
+ GetMethodsNameWithAttributesFromType(nestedType, searchedAttributes, avoidedAttributes, matchingMethods);
}
}

0 comments on commit 0114d07

Please sign in to comment.