private void InitializeXmlFile(ITestResult[] result)
        {
            var summaryResults = new ResultSummarizer(result);

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

            xmlWriter.WriteStartElement("test-results");

            xmlWriter.WriteAttributeString("name",
                                           resultsName);
            xmlWriter.WriteAttributeString("total",
                                           summaryResults.TestsRun.ToString());
            xmlWriter.WriteAttributeString("errors",
                                           summaryResults.Errors.ToString());
            xmlWriter.WriteAttributeString("failures",
                                           summaryResults.Failures.ToString());
            xmlWriter.WriteAttributeString("not-run",
                                           summaryResults.TestsNotRun.ToString());
            xmlWriter.WriteAttributeString("inconclusive",
                                           summaryResults.Inconclusive.ToString());
            xmlWriter.WriteAttributeString("ignored",
                                           summaryResults.Ignored.ToString());
            xmlWriter.WriteAttributeString("skipped",
                                           summaryResults.Skipped.ToString());
            xmlWriter.WriteAttributeString("invalid",
                                           summaryResults.NotRunnable.ToString());

            DateTime now = DateTime.Now;

            xmlWriter.WriteAttributeString("date",
                                           XmlConvert.ToString(now,
                                                               "yyyy-MM-dd"));
            xmlWriter.WriteAttributeString("time",
                                           XmlConvert.ToString(now,
                                                               "HH:mm:ss"));
            WriteEnvironment();
            WriteCultureInfo();
        }
Пример #2
0
		private void InitializeXmlFile(ITestResult[] result)
		{
			var summaryResults = new ResultSummarizer(result);

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

			xmlWriter.WriteStartElement("test-results");

			xmlWriter.WriteAttributeString("name",
											resultsName);
			xmlWriter.WriteAttributeString("total",
											summaryResults.TestsRun.ToString());
			xmlWriter.WriteAttributeString("errors",
											summaryResults.Errors.ToString());
			xmlWriter.WriteAttributeString("failures",
											summaryResults.Failures.ToString());
			xmlWriter.WriteAttributeString("not-run",
											summaryResults.TestsNotRun.ToString());
			xmlWriter.WriteAttributeString("inconclusive",
											summaryResults.Inconclusive.ToString());
			xmlWriter.WriteAttributeString("ignored",
											summaryResults.Ignored.ToString());
			xmlWriter.WriteAttributeString("skipped",
											summaryResults.Skipped.ToString());
			xmlWriter.WriteAttributeString("invalid",
											summaryResults.NotRunnable.ToString());

			DateTime now = DateTime.Now;
			xmlWriter.WriteAttributeString("date",
											XmlConvert.ToString(now,
																"yyyy-MM-dd"));
			xmlWriter.WriteAttributeString("time",
											XmlConvert.ToString(now,
																"HH:mm:ss"));
			WriteEnvironment();
			WriteCultureInfo();
		}