1
// ****************************************************************
2
// Copyright 2012, Charlie Poole
3
// This is free software licensed under the NUnit license. You may
4
// obtain a copy of the license at http://nunit.org
5
// ****************************************************************
10
namespace NUnit.Util.Tests
13
public class TestRunnerFactoryTests
15
private RuntimeFramework currentFramework = RuntimeFramework.CurrentFramework;
16
private string testDll = "/test.dll";
17
private DefaultTestRunnerFactory factory;
18
private TestPackage package;
23
factory = new DefaultTestRunnerFactory();
24
package = new TestPackage(testDll);
28
public void SameFrameworkUsesTestDomain()
30
package.Settings["RuntimeFramework"] = currentFramework;
31
Assert.That( factory.MakeTestRunner(package), Is.TypeOf(typeof(TestDomain)));
34
#if CLR_2_0 || CLR_4_0
36
public void DifferentRuntimeUsesProcessRunner()
38
RuntimeType runtime = currentFramework.Runtime == RuntimeType.Net
39
? RuntimeType.Mono : RuntimeType.Net;
40
package.Settings["RuntimeFramework"] = new RuntimeFramework(runtime, currentFramework.ClrVersion);
41
Assert.That(factory.MakeTestRunner(package), Is.TypeOf(typeof(ProcessRunner)));
45
public void DifferentVersionUsesProcessRunner()
47
int major = currentFramework.ClrVersion.Major == 2 ? 4 : 2;
48
package.Settings["RuntimeFramework"] = new RuntimeFramework(currentFramework.Runtime, new Version(major,0));
49
Assert.That(factory.MakeTestRunner(package), Is.TypeOf(typeof(ProcessRunner)));
1
// ****************************************************************
2
// Copyright 2012, Charlie Poole
3
// This is free software licensed under the NUnit license. You may
4
// obtain a copy of the license at http://nunit.org
5
// ****************************************************************
10
namespace NUnit.Util.Tests
13
public class TestRunnerFactoryTests
15
private RuntimeFramework currentFramework = RuntimeFramework.CurrentFramework;
16
private string testDll = "/test.dll";
17
private DefaultTestRunnerFactory factory;
18
private TestPackage package;
23
factory = new DefaultTestRunnerFactory();
24
package = new TestPackage(testDll);
28
public void SameFrameworkUsesTestDomain()
30
package.Settings["RuntimeFramework"] = currentFramework;
31
Assert.That( factory.MakeTestRunner(package), Is.TypeOf(typeof(TestDomain)));
34
#if CLR_2_0 || CLR_4_0
36
public void DifferentRuntimeUsesProcessRunner()
38
RuntimeType runtime = currentFramework.Runtime == RuntimeType.Net
39
? RuntimeType.Mono : RuntimeType.Net;
40
package.Settings["RuntimeFramework"] = new RuntimeFramework(runtime, currentFramework.ClrVersion);
41
Assert.That(factory.MakeTestRunner(package), Is.TypeOf(typeof(ProcessRunner)));
45
public void DifferentVersionUsesProcessRunner()
47
int major = currentFramework.ClrVersion.Major == 2 ? 4 : 2;
48
package.Settings["RuntimeFramework"] = new RuntimeFramework(currentFramework.Runtime, new Version(major,0));
49
Assert.That(factory.MakeTestRunner(package), Is.TypeOf(typeof(ProcessRunner)));