Exemple #1
0
        private static FailureSite GetNUnitFailureSite(TestResultShim.Site site)
        {
            switch (site)
            {
            case TestResultShim.Site.Test:
                return(FailureSite.Test);

            case TestResultShim.Site.SetUp:
                return(FailureSite.SetUp);

            case TestResultShim.Site.TearDown:
                return(FailureSite.TearDown);

            case TestResultShim.Site.Parent:
                return(FailureSite.Parent);

            case TestResultShim.Site.Child:
                return(FailureSite.Child);

            default:
                throw new ArgumentOutOfRangeException("site");
            }
        }
        public static void Error(TestResultShim testResult, string multilineName, Exception exception, IEnumerable <string> traceMessages, TestResultShim.Site failureSite = TestResultShim.Site.Test)
        {
            traceMessages = traceMessages ?? new List <string>();

            testResult.SetError(BuildMessage(exception), BuildStackTrace(exception, multilineName, traceMessages), failureSite);
        }