Exemplo n.º 1
0
        public void Parse()
        {
            // Arrange
            string xml = XmlPathUtility.GetTestXmlContent("XUnit2.xml");

            // Act
            TestRun testRun = XUnit2TestResultsParser.Parse(XDocument.Parse(xml));

            // Assert
            AssertTestRun(testRun, 12, 4, 6, 2, "Failed", false, "XUnit 09/23/2018 19:57:53");
        }
Exemplo n.º 2
0
        public void ParseXml()
        {
            // Arrange
            string path = XmlPathUtility.GetTestXmlPath("XUnit2.xml");
            XUnit2TestResultsParser testResultsParser = new XUnit2TestResultsParser();

            // Act
            TestRun testRun = testResultsParser.ParseXml(path);

            // Assert
            AssertTestRun(testRun, 12, 4, 6, 2, "Failed", false, "XUnit 09/23/2018 19:57:53");
        }
Exemplo n.º 3
0
        public void Parse_ShouldThrowArgumentNull_WhenXDocumentIsNull()
        {
            // Arrange - Act
            ArgumentNullException argumentNullException = Assert.Throws <ArgumentNullException>(() => XUnit2TestResultsParser.Parse(null));

            // Assert
            Assert.AreEqual($"Value cannot be null.{Environment.NewLine}Parameter name: xmlDocument", argumentNullException.Message);
        }