public void OnSpecificationStart(SpecificationInfo specification)
        {
            TestCase testCase = ConvertSpecificationToTestCase(specification, this.settings);

            this.frameworkHandle.RecordStart(testCase);
            this.currentRunStats = new RunStats();
        }
        public void OnFatalError(ExceptionResult exception)
        {
            if (this.currentRunStats != null)
            {
                this.currentRunStats.Stop();
                this.currentRunStats = null;
            }

            this.frameworkHandle.SendMessage(TestMessageLevel.Error, "Machine Specifications Visual Studio Test Adapter - Fatal error while executing test." + Environment.NewLine + exception.ToString());
        }
Beispiel #3
0
        public void OnFatalError(ExceptionResult exception)
        {
            if (this.currentRunStats != null)
            {
                this.currentRunStats.Stop();
                this.currentRunStats = null;
            }

            this.frameworkHandle.SendMessage(TestMessageLevel.Error, Strings.RUNERROR + Environment.NewLine + exception.ToString());
        }
        public void OnFatalError(ExceptionResult exception)
        {
            if (this.currentRunStats != null)
            {
                this.currentRunStats.Stop();
                this.currentRunStats = null;
            }

            this.frameworkHandle.SendMessage(TestMessageLevel.Error, Strings.RUNERROR + Environment.NewLine + exception.ToString());
        }
        private static TestResult ConverResultToTestResult(TestCase testCase, Result result, RunStats runStats)
        {
            TestResult testResult = new TestResult(testCase)
            {
                ComputerName = Environment.MachineName,
                Outcome      = MapSpecificationResultToTestOutcome(result),
            };

            if (result.Exception != null)
            {
                testResult.ErrorMessage    = result.Exception.Message;
                testResult.ErrorStackTrace = result.Exception.ToString();
            }

            if (runStats != null)
            {
                testResult.StartTime = runStats.Start;
                testResult.EndTime   = runStats.End;
                testResult.Duration  = runStats.Duration;
            }

            return(testResult);
        }
 public void OnSpecificationStart(SpecificationInfo specification)
 {
     TestCase testCase = ConvertSpecificationToTestCase(specification, this.settings);
     this.frameworkHandle.RecordStart(testCase);
     this.currentRunStats = new RunStats();
 }
        private static TestResult ConverResultToTestResult(TestCase testCase, Result result, RunStats runStats)
        {
            TestResult testResult = new TestResult(testCase) {
                ComputerName = Environment.MachineName,
                Outcome = MapSpecificationResultToTestOutcome(result),
            };

            if (result.Exception != null) 
            {
                testResult.ErrorMessage = result.Exception.Message;
                testResult.ErrorStackTrace = result.Exception.ToString();
            }

            if (runStats != null) 
            {
                testResult.StartTime = runStats.Start;
                testResult.EndTime = runStats.End;
                testResult.Duration = runStats.Duration;
            }

            return testResult;
        }