void OnTestSuite(XElement xml)
        {
            var testName = xml.Attribute("fullname")?.Value;
            var output   = xml.Elements("output").FirstOrDefault()?.Value;

            SuiteFinished?.Invoke(this, new TestEventArgs(testName, output));
        }
Esempio n. 2
0
        public void OnTestEvent(string report)
        {
            XmlNode xmlNode = XmlHelper.CreateXmlNode(report);

            switch (xmlNode.Name)
            {
            case "start-test":
                TestStarting?.Invoke(new TestNodeEventArgs(TestAction.TestStarting, new TestNode(xmlNode)));
                break;

            case "start-suite":
                SuiteStarting?.Invoke(new TestNodeEventArgs(TestAction.SuiteStarting, new TestNode(xmlNode)));
                break;

            case "start-run":
                RunStarting?.Invoke(new RunStartingEventArgs(xmlNode.GetAttribute("count", -1)));
                break;

            case "test-case":
                ResultNode result = new ResultNode(xmlNode);
                _resultIndex[result.Id] = result;
                TestFinished?.Invoke(new TestResultEventArgs(TestAction.TestFinished, result));
                break;

            case "test-suite":
                result = new ResultNode(xmlNode);
                _resultIndex[result.Id] = result;
                SuiteFinished?.Invoke(new TestResultEventArgs(TestAction.SuiteFinished, result));
                break;

            case "test-run":
                result = new ResultNode(xmlNode);
                _resultIndex[result.Id] = result;
                RunFinished?.Invoke(new TestResultEventArgs(TestAction.RunFinished, result));
                break;
            }
        }