示例#1
0
        public void MissingStackTracesAndExceptionTypes()
        {
            var failureInfo = new FailureInformation();
            failureInfo.AddMessage("Message 1");
            failureInfo.AddMessage("Message 2");
            failureInfo.AddMessage("Message 3");
            failureInfo.AddIndex(-1);
            failureInfo.AddIndex(0);
            failureInfo.AddIndex(0);
            failureInfo.AddExceptionType("ExceptionType1");
            failureInfo.AddExceptionType("Xunit.Sdk.ExceptionType2");
            failureInfo.AddStackTrace("Stack Trace 1");
            failureInfo.AddStackTrace("Stack Trace 2");

            var result = ExceptionUtility.CombineStackTraces(failureInfo);

            Assert.Equal("Stack Trace 1" + Environment.NewLine +
                         "----- Inner Stack Trace #1 (Xunit.Sdk.ExceptionType2) -----" + Environment.NewLine +
                         "Stack Trace 2" + Environment.NewLine +
                         "----- Inner Stack Trace #2 () -----" + Environment.NewLine, result);
        }
示例#2
0
        public void MissingExceptionTypes()
        {
            var failureInfo = new FailureInformation();
            failureInfo.AddMessage("Message 1");
            failureInfo.AddMessage("Message 2");
            failureInfo.AddMessage("Message 3");
            failureInfo.AddIndex(-1);
            failureInfo.AddIndex(0);
            failureInfo.AddIndex(0);
            failureInfo.AddExceptionType("ExceptionType1");
            failureInfo.AddExceptionType("Xunit.Sdk.ExceptionType2");

            var result = ExceptionUtility.CombineMessages(failureInfo);

            Assert.Equal("ExceptionType1 : Message 1" + Environment.NewLine +
                         "---- Message 2" + Environment.NewLine +
                         "----  : Message 3", result);
        }