2
// Copyright (C) 2002. James W. Newkirk, Michael C. Two, Alexei A. Vorontsov
8
using System.Reflection;
9
using System.Runtime.Remoting;
12
/// Summary description for RemoteTestRunner.
14
public class RemoteTestRunner : MarshalByRefObject
16
private TestSuite suite;
17
private string fullName;
18
private Nunit.Core.EventListener handler;
19
private string assemblyName;
20
private TextWriter stdOutWriter;
21
private TextWriter stdErrWriter;
23
public RemoteTestRunner(string assemblyName, Nunit.Core.EventListener handler, TextWriter stdOutWriter, TextWriter stdErrOut)
25
this.assemblyName = assemblyName;
26
suite = TestSuiteBuilder.Build(assemblyName);
27
TestName = suite.FullName;
29
this.handler = handler;
30
this.stdErrWriter = stdErrOut;
31
this.stdOutWriter = stdOutWriter;
34
public TestResult Run()
36
Console.SetOut(stdOutWriter);
37
Console.SetError(stdErrWriter);
39
Test test = FindByName(suite, fullName);
40
TestResult result = test.Run(handler);
44
private Test FindByName(Test test, string fullName)
46
if(test.FullName.Equals(fullName)) return test;
51
TestSuite suite = (TestSuite)test;
52
foreach(Test testCase in suite.Tests)
54
result = FindByName(testCase, fullName);
55
if(result != null) break;
62
public string TestName
64
get { return fullName; }
65
set { fullName = value; }