Пример #1
0
 public void Reset()
 {
     TestResult = null;
 }
Пример #2
0
 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);
 }