public void Reset() { TestResult = null; }
public override void SetTestResult(TestResult result) { base.SetTestResult(result); }
public virtual void SetTestResult(TestResult result) { _titleLabel.Text = result.MethodName; _messageLabel.Text = result.Message; ShowResult(result.WasSuccessful); }
private TestResult RunTearDownMethod(object testClassInstance, IMethod tearDownMethod, ITestMethod testMethod) { if(tearDownMethod == null) return null; TestResult testResult = null; try { tearDownMethod.Invoke(testClassInstance); } catch (Exception ex) { string className = testClassInstance.GetType().Name; testResult = new TestResult(className, testMethod.Name, false, "TearDown failed: ", ex); } return testResult; }
private void FireSingleTestCompleted(TestResult testResult) { if(SingleTestCompleted != null) SingleTestCompleted(this, new EventArgs<TestResult>(testResult)); }
private TestResult RunTestMethod(object testClassInstance, ITestMethod testMethod) { TestResult testResult = null; string className = testClassInstance.GetType().Name; string methodName = testMethod.Name; try { testMethod.Invoke(testClassInstance); testResult = new TestResult(className, methodName, true, "The test ran successfully."); } catch (Exception ex) { testResult = new TestResult(className, methodName, false, "The test failed: ", ex); } return testResult; }
public void SetTestResult(TestResult testResult) { _testResult = testResult; SetText(_testResult.MethodName); ShowResult(_testResult.WasSuccessful); }