コード例 #1
0
        private void InitializeXmlFile(XmlNode result)
        {
            //ResultSummary summary = new ResultSummary(result);
            NUnit2ResultSummary summary = new NUnit2ResultSummary(result);

            xmlWriter.WriteStartDocument(false);
            xmlWriter.WriteComment("This file represents the results of running a test suite");

            xmlWriter.WriteStartElement("test-results");

            xmlWriter.WriteAttributeString("name", result.GetAttribute("fullname"));
            xmlWriter.WriteAttributeString("total", summary.ResultCount.ToString());
            xmlWriter.WriteAttributeString("errors", summary.Errors.ToString());
            xmlWriter.WriteAttributeString("failures", summary.Failures.ToString());
            xmlWriter.WriteAttributeString("not-run", summary.TestsNotRun.ToString());
            xmlWriter.WriteAttributeString("inconclusive", summary.Inconclusive.ToString());
            xmlWriter.WriteAttributeString("ignored", summary.Ignored.ToString());
            xmlWriter.WriteAttributeString("skipped", summary.Skipped.ToString());
            xmlWriter.WriteAttributeString("invalid", summary.NotRunnable.ToString());

            DateTime start = result.GetAttribute("start-time", DateTime.UtcNow);

            xmlWriter.WriteAttributeString("date", start.ToString("yyyy-MM-dd"));
            xmlWriter.WriteAttributeString("time", start.ToString("HH:mm:ss"));
            WriteEnvironment();
            WriteCultureInfo();
        }
コード例 #2
0
        private void InitializeXmlFile(XmlNode result)
        {
            NUnit2ResultSummary summary = new NUnit2ResultSummary(result);

            xmlWriter.WriteStartDocument(false);
            xmlWriter.WriteComment("This file represents the results of running a test suite");

            xmlWriter.WriteStartElement("test-results");

            xmlWriter.WriteAttributeString("name", GetPathOfFirstTestFile(result));
            xmlWriter.WriteAttributeString("total", summary.ResultCount.ToString());
            xmlWriter.WriteAttributeString("errors", summary.Errors.ToString());
            xmlWriter.WriteAttributeString("failures", summary.Failures.ToString());
            xmlWriter.WriteAttributeString("not-run", summary.TestsNotRun.ToString());
            xmlWriter.WriteAttributeString("inconclusive", summary.Inconclusive.ToString());
            xmlWriter.WriteAttributeString("ignored", summary.Ignored.ToString());
            xmlWriter.WriteAttributeString("skipped", summary.Skipped.ToString());
            xmlWriter.WriteAttributeString("invalid", summary.NotRunnable.ToString());
            
            DateTime start = result.GetAttribute("start-time", DateTime.UtcNow);
            xmlWriter.WriteAttributeString("date", start.ToString("yyyy-MM-dd"));
            xmlWriter.WriteAttributeString("time", start.ToString("HH:mm:ss"));
            WriteEnvironment();
            WriteCultureInfo();
        }