/// <summary> /// Protected constructor constructs a test result given /// a test and a name. /// </summary> /// <param name="test">The test to be used</param> /// <param name="name">Name for this result</param> protected TestResult(TestInfo test, string name) { this.name = name; this.test = test; this.RunState = RunState.Runnable; if (test != null) { this.description = test.Description; this.runState = test.RunState; this.messageString = test.IgnoreReason; } }
/// <summary> /// Construct a test result given a TestInfo /// </summary> /// <param name="test">The test to be used</param> public TestResult(TestInfo test) { this.test = test; this.message = test.IgnoreReason; }
/// <summary> /// Construct a TestNode given a test /// </summary> public TestSuiteTreeNode( TestInfo test ) : base(test.TestName.Name) { this.test = test; UpdateImageIndex(); }
public bool Run(TestInfo test, TestSuiteResult suite_result, string test_name, EventListener listener, ITestFilter filter, int timeout) { listener = new ProxyListener (listener); TestRunnerDelegate runner = new TestRunnerDelegate (delegate { return server.Run (test_name, listener, filter); }); IAsyncResult ar = runner.BeginInvoke (test_name, null, filter, null, null); if (!ar.AsyncWaitHandle.WaitOne (timeout) || !ar.IsCompleted) { TestCaseResult error = new TestCaseResult (test); string msg = String.Format ("Timeout after {0} ms", timeout); error.Failure (msg, null, FailureSite.Parent); suite_result.AddResult (error); return false; } try { TestResult result = runner.EndInvoke (ar); if (result != null) { suite_result.AddResult (result); return true; } TestCaseResult error = new TestCaseResult (test); error.Failure ("Unknown error", null, FailureSite.Parent); suite_result.AddResult (error); return false; } catch (Exception ex) { TestCaseResult error = new TestCaseResult (test); string msg = String.Format ("Unknown exception: {0}", ex); error.Failure (msg, null, FailureSite.Parent); suite_result.AddResult (error); return false; } }
/// <summary> /// Construct a result for a test case /// </summary> /// <param name="testCase">The test case for which this is a result</param> public TestCaseResult(TestInfo testCase) : base(testCase, testCase.TestName.FullName) { }
/// <summary> /// Construct a TestSuiteResult from a test and a name /// </summary> /// <param name="test"></param> /// <param name="name"></param> public TestSuiteResult(TestInfo test, string name) : base(test, name) { }
public FakeTestResult(TestInfo test) : base(test) { }
/// <summary> /// Initializes a new instance of the <see cref="TestUnit"/> class. /// </summary> /// <param name="test"></param> /// <param name="testRun">The test run.</param> /// <param name="assemblyName">Name of the assembly.</param> public TestUnit(ITest test, TestRun testRun, string assemblyName) { Run = testRun; AssemblyName = assemblyName; Info = new TestInfo(test); }