Skip to content
Browse files

Adding NUnit simple name filter

  • Loading branch information...
1 parent 7666ee7 commit c47aece2e4251f7d16045c719590e3b56a07c7b3 @codereflection committed Jan 17, 2012
Showing with 15 additions and 2 deletions.
  1. +1 −1 src/Giles.Core/AppDomains/GilesAppDomainRunner.cs
  2. +14 −1 src/Runners/Giles.Runner.NUnit/NUnitRunner.cs
View
2 src/Giles.Core/AppDomains/GilesAppDomainRunner.cs
@@ -19,7 +19,7 @@ public IEnumerable<SessionResults> Run(string testAssemblyPath)
var testFrameworkRunner = new TestFrameworkResolver().Resolve(testAssembly).ToList();
var result = new List<SessionResults>();
- testFrameworkRunner.ForEach(x => result.Add(x.RunAssembly(testAssembly, new[] { "Teh.Tests.TestTheClassThatDoesReturnsSomething" })));
+ testFrameworkRunner.ForEach(x => result.Add(x.RunAssembly(testAssembly, new[] { "Teh.Tests.TestTheClassThatDoesReturnsSomething", "Teh.Tests.NUnitTests" })));
return result;
}
}
View
15 src/Runners/Giles.Runner.NUnit/NUnitRunner.cs
@@ -1,22 +1,35 @@
+using System;
using System.Collections.Generic;
+using System.Linq;
using System.Reflection;
using Giles.Core.Runners;
+using Giles.Core.Utility;
using NUnit.Core;
+using NUnit.Core.Filters;
namespace Giles.Runner.NUnit
{
public class NUnitRunner : IFrameworkRunner
{
+ IEnumerable<string> filters;
+
public SessionResults RunAssembly(Assembly assembly, IEnumerable<string> filters)
{
+ this.filters = filters;
var remoteTestRunner = new RemoteTestRunner(0);
var package = SetupTestPackager(assembly);
remoteTestRunner.Load(package);
var listener = new GilesNUnitEventListener();
- remoteTestRunner.Run(listener);
+ remoteTestRunner.Run(listener, GetFilters());
return listener.SessionResults;
}
+ ITestFilter GetFilters()
+ {
+ var simpleNameFilter = new SimpleNameFilter(filters.ToArray());
+ return simpleNameFilter;
+ }
+
public IEnumerable<string> RequiredAssemblies()
{
return new[]

0 comments on commit c47aece

Please sign in to comment.
Something went wrong with that request. Please try again.