private void ReadTestSuiteRun(TestRun testRun, XmlReader xmlReader) { xmlReader.Read(); while (xmlReader.NodeType != XmlNodeType.EndElement) { switch (xmlReader.Name) { case "suite": string suiteId = ReadAttribute(xmlReader, "id"); TestSuiteRun testSuiteRun = new TestSuiteRun(suiteId); ReadTestCaseRuns(testSuiteRun, xmlReader); testRun.AddTestSuiteRun(testSuiteRun); break; default: { throw new NotSupportedException( string.Format( CultureInfo.InvariantCulture, "Not supported xml node type. Node type = {0}", xmlReader.NodeType)); } } } xmlReader.Read(); }
private void ReadTestCaseRuns(TestSuiteRun testSuiteRun, XmlReader xmlReader) { if (xmlReader.IsEmptyElement) { xmlReader.Skip(); return; } xmlReader.Read(); while (xmlReader.NodeType != XmlNodeType.EndElement) { switch (xmlReader.Name) { case "case": string gallioStatus = ReadAttribute(xmlReader, "status"); TestExecutionStatus status = TestExecutionStatus.NotImplemented; switch (gallioStatus) { case "passed": status = TestExecutionStatus.Successful; break; case "failed": status = TestExecutionStatus.Failed; break; case "pending": case "skipped": case "inconclusive": status = TestExecutionStatus.NotImplemented; break; default: throw new NotSupportedException(String.Format(CultureInfo.InvariantCulture, "Gallio test status '{0}' not supported", gallioStatus)); } TestCaseRun testCaseRun = new TestCaseRun( ReadAttribute(xmlReader, "id"), status); ReadTestCaseRun(testCaseRun, xmlReader); testSuiteRun.AddTestCaseRun(testCaseRun); break; default: { throw new NotSupportedException( string.Format( CultureInfo.InvariantCulture, "Unsupported xml node '{0}'", xmlReader.Name)); } } } xmlReader.Read(); }
public void AddTestSuiteRun(TestSuiteRun testSuiteRun) { testSuitesRuns.Add(testSuiteRun.TestSuiteId, testSuiteRun); }