public void Aggregate_CalculatesAggregateResultCorrectly(string firstResult, string secondResult, string aggregateResult) { string firstResultText = $"<test-assembly result=\"{firstResult}\" total=\"23\" passed=\"23\" failed=\"0\" inconclusive=\"0\" skipped=\"0\" asserts=\"40\" />"; string secondResultText = $"<test-assembly result=\"{secondResult}\" total=\"42\" passed=\"31\" failed=\"4\" inconclusive=\"5\" skipped=\"2\" asserts=\"53\" />"; var firstEngineResult = new TestEngineResult(firstResultText); var secondEngineResult = new TestEngineResult(secondResultText); var data = new XmlNode[] { firstEngineResult.Xml, secondEngineResult.Xml }; XmlNode combined = ResultHelper.Aggregate("test-run", "ID", "NAME", "FULLNAME", data); Assert.That(combined.Attributes["result"].Value, Is.EqualTo(aggregateResult)); }
public void AggregateXmlNodes() { XmlNode combined = ResultHelper.Aggregate("test-run", "NAME", "FULLNAME", twoNodes); Assert.That(combined.Name, Is.EqualTo("test-run")); Assert.That(combined.Attributes["name"].Value, Is.EqualTo("NAME")); Assert.That(combined.Attributes["fullname"].Value, Is.EqualTo("FULLNAME")); Assert.That(combined.Attributes["result"].Value, Is.EqualTo("Failed")); Assert.That(combined.Attributes["total"].Value, Is.EqualTo("65")); Assert.That(combined.Attributes["passed"].Value, Is.EqualTo("54")); Assert.That(combined.Attributes["failed"].Value, Is.EqualTo("4")); Assert.That(combined.Attributes["inconclusive"].Value, Is.EqualTo("5")); Assert.That(combined.Attributes["skipped"].Value, Is.EqualTo("2")); Assert.That(combined.Attributes["asserts"].Value, Is.EqualTo("93")); }