public void Reset()
 {
     TestResult = null;
 }
 public override void SetTestResult(TestResult result)
 {
     base.SetTestResult(result);
 }
示例#3
0
 public virtual void SetTestResult(TestResult result)
 {
     _titleLabel.Text = result.MethodName;
     _messageLabel.Text = result.Message;
     ShowResult(result.WasSuccessful);
 }
示例#4
0
        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;
        }
示例#5
0
 private void FireSingleTestCompleted(TestResult testResult)
 {
     if(SingleTestCompleted != null)
         SingleTestCompleted(this, new EventArgs<TestResult>(testResult));
 }
示例#6
0
        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;
        }
示例#7
0
 public void SetTestResult(TestResult testResult)
 {
     _testResult = testResult;
     SetText(_testResult.MethodName);
     ShowResult(_testResult.WasSuccessful);
 }