예제 #1
0
        public void UpdateCounters(List<TestRunnerResult> resultList)
        {
            m_PassedCount = m_FailedCount = m_NotRunCount =  m_InconclusiveCount = m_SkippedCount = 0;
            foreach (var result in resultList)
            {
                if (result.isSuite)
                    continue;
                switch (result.resultStatus)
                {
                    case TestRunnerResult.ResultStatus.Passed:
                        m_PassedCount++;
                        break;
                    case TestRunnerResult.ResultStatus.Failed:
                        m_FailedCount++;
                        break;
                    case TestRunnerResult.ResultStatus.Inconclusive:
                        m_InconclusiveCount++;
                        break;
                    case TestRunnerResult.ResultStatus.Skipped:
                        m_SkippedCount++;
                        break;
                    case TestRunnerResult.ResultStatus.NotRun:
                    default:
                        m_NotRunCount++;
                        break;
                }
            }

            var succeededTooltip = string.Format("Show tests that succeeded\n{0} succeeded", m_PassedCount);
            m_SucceededBtn = new GUIContent(PassedCount.ToString(), Icons.s_SuccessImg, succeededTooltip);
            var failedTooltip = string.Format("Show tests that failed\n{0} failed\n{1} inconclusive", m_FailedCount, m_InconclusiveCount);
            m_FailedBtn = new GUIContent(FailedCount.ToString(), Icons.s_FailImg, failedTooltip);
            var notRunTooltip = string.Format("Show tests that didn't run\n{0} didn't run\n{1} skipped or ignored", m_NotRunCount, m_SkippedCount);
            m_NotRunBtn = new GUIContent(NotRunCount.ToString(), Icons.s_UnknownImg, notRunTooltip);
        }
예제 #2
0
        private HtmlTag BuildSummaryBox()
        {
            return(new HtmlTag("table").Append(
                       new HtmlTag("thead").Append(
                           new HtmlTag("tr").Append(
                               new HtmlTag("th").AppendText("Stories"),
                               new HtmlTag("th").AppendText("Scenarios"),
                               new HtmlTag("th").Append(
                                   new HtmlTag("div").Append(
                                       HtmlReportPrebuilt.PassedIcon
                                       ),

                                   new HtmlTag("input").Attr("type", "checkbox").Attr("checked", "checked").Id("Passed")
                                   ),
                               new HtmlTag("th").Append(
                                   new HtmlTag("div").Append(
                                       HtmlReportPrebuilt.FailedIcon
                                       ),
                                   new HtmlTag("input").Attr("type", "checkbox").Attr("checked", "checked").Id("Failed")
                                   ),
                               new HtmlTag("th").Append(
                                   new HtmlTag("div").Append(
                                       HtmlReportPrebuilt.InconclusiveIcon
                                       ),
                                   new HtmlTag("input").Attr("type", "checkbox").Attr("checked", "checked").Id("Inconclusive")
                                   ),
                               new HtmlTag("th").Append(
                                   new HtmlTag("div").Append(
                                       HtmlReportPrebuilt.NotImplementedIcon
                                       ),
                                   new HtmlTag("input").Attr("type", "checkbox").Attr("checked", "checked").Id("NotImplemented")
                                   )
                               )
                           ),
                       new HtmlTag("tbody").Append(
                           new HtmlTag("tr").Append(
                               new HtmlTag("td").AppendText(StoriesCount.ToString()),
                               new HtmlTag("td").AppendText(ScenariosCount.ToString()),
                               new HtmlTag("td").AppendText(PassedCount.ToString()),
                               new HtmlTag("td").AppendText(FailedCount.ToString()),
                               new HtmlTag("td").AppendText(InconclusiveCount.ToString()),
                               new HtmlTag("td").AppendText(NotImplementedCount.ToString())
                               )
                           )
                       ).Attr("width", "1000"));
        }
예제 #3
0
파일: Form1.cs 프로젝트: ElChupos/NetUp
        private void UpdateLabels()
        {
            SucceedLabel.Text = SucceedCount.ToString();
            FailedLabel.Text  = FailedCount.ToString();

            SuccessRoot.Visible = HasSucceeded;
            FailRoot.Visible    = HasFailed;
            if (GetLastBlock(out ConnectionBlock failBlock, p => p.Status != IPStatus.Success))
            {
                LastFailLabel.Text = $"{failBlock.EndTime.ToString()}: {FormatTimeSpan(failBlock.Duration)}";
            }

            if (GetLastBlock(out ConnectionBlock successBlock, p => p.Status == IPStatus.Success))
            {
                LastSuccessLabel.Text = $"{successBlock.EndTime.ToString()}: {FormatTimeSpan(successBlock.Duration)}";
            }
            if (connections.Count > 0)
            {
                var connection = connections[connections.Count - 1];
                currentConnectionLength.Text = $"Current connection: {connection.Status} {FormatTimeSpan(connection.Duration)}";
            }
        }