コード例 #1
0
        public static void OnAssertInconclusive(string message)
        {
            var handler = OnAssertCompleted;

            if (handler != null)
            {
                handler(null, new AssertCompletedEventArgs(TestResult.Inconclusive(message)));
            }
        }
コード例 #2
0
        public TestResult Run()
        {
            TestResult result;
            var        duration = new TimeSpan();

            try
            {
                AssertHandler.OnAssertCompleted += HandleAssertCompleted;
                duration = _hostApp.TimedMethodCall(_projectName, _moduleName, _methodName);
                AssertHandler.OnAssertCompleted -= HandleAssertCompleted;

                result = EvaluateResults();
            }
            catch (Exception exception)
            {
                result = TestResult.Inconclusive("Test raised an error. " + exception.Message);
            }

            return(new TestResult(result, duration.Milliseconds));
        }
コード例 #3
0
        public TestResult Run()
        {
            _assertResults.Clear(); //clear previous results to account for changes being made

            TestResult result;
            var        duration = new TimeSpan();

            try
            {
                AssertHandler.OnAssertCompleted += HandleAssertCompleted;
                duration = _hostApp.TimedMethodCall(_qualifiedMemberName);
                AssertHandler.OnAssertCompleted -= HandleAssertCompleted;

                result = EvaluateResults();
            }
            catch (Exception exception)
            {
                result = TestResult.Inconclusive("Test raised an error. " + exception.Message);
            }

            return(new TestResult(result, duration.Milliseconds));
        }