Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

display TestCases like normal tests in treeview

  • Loading branch information...
commit 0dc753718f7388a3f5af2a5e1ad0243ddc3570b2 1 parent 5425443
@siegfriedpammer siegfriedpammer authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/AddIns/Analysis/UnitTesting/Extensions.cs
View
7 src/AddIns/Analysis/UnitTesting/Extensions.cs
@@ -24,6 +24,7 @@ namespace ICSharpCode.UnitTesting
public static class Extensions
{
static readonly ITypeReference testAttribute = new GetClassTypeReference("NUnit.Framework", "TestAttribute", 0);
+ static readonly ITypeReference testCaseAttribute = new GetClassTypeReference("NUnit.Framework", "TestCaseAttribute", 0);
public static bool IsTestProject(this IProject project)
{
@@ -39,7 +40,8 @@ public static bool IsTestMethod(this IMethod method, ICompilation compilation)
if (method == null)
throw new ArgumentNullException("method");
var testAttribute = Extensions.testAttribute.Resolve(compilation.TypeResolveContext);
- return method.Attributes.Any(a => a.AttributeType.Equals(testAttribute));
+ var testCaseAttribute = Extensions.testCaseAttribute.Resolve(compilation.TypeResolveContext);
+ return method.Attributes.Any(a => a.AttributeType.Equals(testAttribute) || a.AttributeType.Equals(testCaseAttribute));
}
public static bool HasTests(this ITypeDefinition type, ICompilation compilation)
@@ -47,7 +49,8 @@ public static bool HasTests(this ITypeDefinition type, ICompilation compilation)
if (type == null)
throw new ArgumentNullException("type");
var testAttribute = Extensions.testAttribute.Resolve(compilation.TypeResolveContext);
- return type.Methods.Any(m => m.Attributes.Any(a => a.AttributeType.Equals(testAttribute)));
+ var testCaseAttribute = Extensions.testCaseAttribute.Resolve(compilation.TypeResolveContext);
+ return type.Methods.Any(m => m.Attributes.Any(a => a.AttributeType.Equals(testAttribute) || a.AttributeType.Equals(testCaseAttribute)));
}
public static IEnumerable<TResult> FullOuterJoin<TOuter, TInner, TKey, TResult>(this IEnumerable<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter,TKey> outerKeySelector, Func<TInner,TKey> innerKeySelector, Func<TOuter,TInner,TResult> resultSelector)
Please sign in to comment.
Something went wrong with that request. Please try again.