示例#1
0
 public void CaseFailed(FailResult result)
 {
     Message("testStarted name='{0}'", result.Name);
     Output(result.Name, result.Output);
     Message("testFailed name='{0}' message='{1}' details='{2}'", result.Name, result.Exceptions.PrimaryException.Message, result.Exceptions.CompoundStackTrace);
     Message("testFinished name='{0}' duration='{1}'", result.Name, DurationInMilliseconds(result.Duration));
 }
示例#2
0
        public void CaseFailed(FailResult result)
        {
            var entry = new StringBuilder();

            var primaryException = result.Exceptions.PrimaryException;

            entry.AppendFormat("{0} failed: {1}", result.Name, primaryException.Message);

            var walk = primaryException;
            while (walk.InnerException != null)
            {
                walk = walk.InnerException;
                entry.AppendLine();
                entry.AppendFormat("    Inner Exception: {0}", walk.Message);
            }

            foreach (var secondaryException in result.Exceptions.SecondaryExceptions)
            {
                entry.AppendLine();
                entry.AppendFormat("    Secondary Failure: {0}", secondaryException.Message);

                walk = secondaryException;
                while (walk.InnerException != null)
                {
                    walk = walk.InnerException;
                    entry.AppendLine();
                    entry.AppendFormat("        Inner Exception: {0}", walk.Message);
                }
            }

            log.Add(entry.ToString());
        }
示例#3
0
 public void CaseFailed(FailResult result)
 {
     using (Foreground.Red)
         Console.WriteLine("Test '{0}' failed: {1}", result.Name, result.Exceptions.PrimaryException.DisplayName);
     Console.WriteLine(result.Exceptions.CompoundStackTrace);
     Console.WriteLine();
 }
 private static string FormatFailReason(FailResult result)
 {
    var reason = result.Exceptions.CompoundStackTrace.Trim();
    var pattern = @"^([ ]*)at ([a-z._()]+) in ([a-z.:\\_ ]+:line \d+)$";
    var replacement = @"$1at $2" + Environment.NewLine + @"$1in $3";
    return Regex.Replace(reason, pattern, replacement, RegexOptions.IgnoreCase | RegexOptions.Multiline);
 }
示例#5
0
 public void CaseFailed(FailResult result)
 {
     tdnet.TestFinished(new TestResult
     {
         Name = result.Name,
         State = TestState.Failed,
         Message = result.Exceptions.PrimaryException.DisplayName,
         StackTrace = result.Exceptions.CompoundStackTrace,
     });
 }
        public void CaseFailed(FailResult result)
        {
            var testResult = new TestResult(TestCase(result.MethodGroup))
            {
                DisplayName = result.Name,
                Outcome = Map(CaseStatus.Failed),
                Duration = result.Duration,
                ComputerName = Environment.MachineName,
                ErrorMessage = result.Exceptions.PrimaryException.DisplayName,
                ErrorStackTrace = result.Exceptions.CompoundStackTrace
            };

            AttachCapturedConsoleOutput(result.Output, testResult);

            log.RecordResult(testResult);
        }
示例#7
0
        public void CaseFailed(FailResult result)
        {
            var caseResult = (CaseResult)result;

            Post(new TestResult
            {
                testFramework = "Fixie",
                fileName = fileName,
                testName = caseResult.Name,
                outcome = "Failed",
                durationMilliseconds = caseResult.Duration.TotalMilliseconds.ToString("0"),
                StdOut = caseResult.Output,
                ErrorMessage = caseResult.Exceptions.PrimaryException.DisplayName,
                ErrorStackTrace = caseResult.Exceptions.CompoundStackTrace
            });
        }
 public void CaseFailed(FailResult result)
 {
 }
示例#9
0
 CaseResult Fail(Case @case)
 {
     var result = new FailResult(@case, assertionLibraryFilter);
     listener.CaseFailed(result);
     return result;
 }
示例#10
0
 public void CaseFailed(FailResult result) => Log.Add(result);
 public void CaseFailed(FailResult result)
 {
    _proxy.TestCompleted(GetTestResult(result.MethodGroup, TestStatus.Fail, FormatFailReason(result)));
 }