예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ErrorMessage"/> class.
        /// </summary>
        /// <param name="ex">The exception that represents the error message.</param>
        public ErrorMessage(Exception ex)
        {
            var failureInfo = ExceptionUtility.ConvertExceptionToFailureInformation(ex);

            ExceptionTypes         = failureInfo.ExceptionTypes;
            Messages               = failureInfo.Messages;
            StackTraces            = failureInfo.StackTraces;
            ExceptionParentIndices = failureInfo.ExceptionParentIndices;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TestClassCleanupFailure"/> class.
        /// </summary>
        public TestCollectionCleanupFailure(IEnumerable <ITestCase> testCases, ITestCollection testCollection, Exception ex)
            : base(testCases, testCollection)
        {
            var failureInfo = ExceptionUtility.ConvertExceptionToFailureInformation(ex);

            ExceptionTypes         = failureInfo.ExceptionTypes;
            Messages               = failureInfo.Messages;
            StackTraces            = failureInfo.StackTraces;
            ExceptionParentIndices = failureInfo.ExceptionParentIndices;
        }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TestCleanupFailure"/> class.
        /// </summary>
        public TestCleanupFailure(ITest test, Exception ex)
            : base(test)
        {
            var failureInfo = ExceptionUtility.ConvertExceptionToFailureInformation(ex);

            ExceptionTypes         = failureInfo.ExceptionTypes;
            Messages               = failureInfo.Messages;
            StackTraces            = failureInfo.StackTraces;
            ExceptionParentIndices = failureInfo.ExceptionParentIndices;
        }
예제 #4
0
        public ExceptionTestCase(Exception exception, IMessageSink diagnosticMessageSink, TestMethodDisplay defaultMethodDisplay, ITestMethod testMethod)
            : base(diagnosticMessageSink, defaultMethodDisplay, testMethod)
        {
            var finfo = ExceptionUtility.ConvertExceptionToFailureInformation(exception);

            Types         = finfo.ExceptionTypes;
            Messages      = finfo.Messages;
            StackTraces   = finfo.StackTraces;
            ParentIndices = finfo.ExceptionParentIndices;
        }
예제 #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ErrorMessage"/> class.
        /// </summary>
        public ErrorMessage(IEnumerable <ITestCase> testCases, Exception ex)
        {
            TestCases = testCases;

            var failureInfo = ExceptionUtility.ConvertExceptionToFailureInformation(ex);

            ExceptionTypes         = failureInfo.ExceptionTypes;
            Messages               = failureInfo.Messages;
            StackTraces            = failureInfo.StackTraces;
            ExceptionParentIndices = failureInfo.ExceptionParentIndices;
        }
예제 #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TestFailed"/> class.
        /// </summary>
        public TestFailed(ITest test,
                          decimal executionTime,
                          string output,
                          Exception ex)
            : base(test, executionTime, output)
        {
            var failureInfo = ExceptionUtility.ConvertExceptionToFailureInformation(ex);

            ExceptionTypes         = failureInfo.ExceptionTypes;
            Messages               = failureInfo.Messages;
            StackTraces            = failureInfo.StackTraces;
            ExceptionParentIndices = failureInfo.ExceptionParentIndices;
        }
예제 #7
0
    public TestFailed(Exception ex)
    {
        TestCase       = new TestCase();
        TestCollection = new TestCollection();
        Output         = String.Empty;

        var failureInfo = ExceptionUtility.ConvertExceptionToFailureInformation(ex);

        ExceptionParentIndices = failureInfo.ExceptionParentIndices;
        ExceptionTypes         = failureInfo.ExceptionTypes;
        Messages    = failureInfo.Messages;
        StackTraces = failureInfo.StackTraces;
    }