Exemple #1
0
        private void NotifyException(TestConf test, Exception e)
        {
            TestName tn = new TestName();
            tn.Name = test.Name;

            PNUnitTestResult tr = new PNUnitTestResult(tn, e.Message);
            tr.Failure(e.Message, e.StackTrace);

            NotifyResult(test.Name, tr);
        }
        private TestResult BuildError(string message, TestConsoleAccess consoleAccess)
        {
            TestName testName = new TestName();
            testName.Name = mPNUnitTestInfo.TestName;
            testName.FullName = mPNUnitTestInfo.TestName;
            testName.TestID = new TestID();

            TestResult result = new PNUnitTestResult(testName, consoleAccess.GetTestOutput());
            result.Failure(message, string.Empty);
            return result;
        }
        private TestResult BuildResult(
            TestResult result,
            TestConsoleAccess consoleAccess,
            PNUnitTestInfo testInfo)
        {
            //the test namespace contains errors
            if( result == null )
            {
                TestName testName = new TestName();
                testName.Name = testInfo.TestName;

                string errormsg = "The test {0} couldn't be found in the assembly {1}";

                result = new PNUnitTestResult(testName, string.Empty);
                result.Failure(
                    string.Format(errormsg, testInfo.TestToRun, testInfo.AssemblyName),
                    string.Empty);

                return result;
            }

            if( !result.IsSuccess /*|| ReturnTestOutput()*/ )
                return new PNUnitTestResult(result, consoleAccess.GetTestOutput());
            else
                return result;
        }