コード例 #1
0
        public static void WriteTestStatus()
        {
            var status    = NunitTestHelpers.GetTestStatus();
            var exception = string.IsNullOrEmpty(NunitTestHelpers.GetExceptionMessageTest())
                 ? ""
                 : string.Format("{0}", "<pre>" + NunitTestHelpers.GetExceptionMessageTest() + "</pre>");
            var stacktrace = string.IsNullOrEmpty(NunitTestHelpers.GetStackTraceResultTest())
                    ? ""
                    : string.Format("{0}", NunitTestHelpers.GetStackTraceResultTest());
            Status logstatus;

            switch (status)
            {
            case TestStatus.Failed:
                logstatus = Status.Fail;

                break;

            case TestStatus.Inconclusive:
                logstatus = Status.Warning;
                break;

            case TestStatus.Skipped:
                logstatus = Status.Skip;
                break;

            default:
                logstatus = Status.Pass;
                break;
            }

            _test.Log(logstatus, "Status do Teste: " + logstatus + "<br />" + exception + "<br />URL: " + SeleniumBase.WebdriverHooks.Driver.Url, AddScreenShot());
        }
コード例 #2
0
        public static Status GetTestStatus()
        {
            TestStatus status = NunitTestHelpers.GetTestStatus();
            Status     logstatus;

            switch (status)
            {
            case TestStatus.Failed:
                logstatus = Status.Fail;
                break;

            case TestStatus.Inconclusive:
                logstatus = Status.Warning;
                break;

            case TestStatus.Skipped:
                logstatus = Status.Skip;
                break;

            default:
                logstatus = Status.Pass;
                break;
            }
            return(logstatus);
        }