コード例 #1
0
        public TestSuiteErrorResult(TestSuiteResult suite,
			XmlAttributeCollection attributes)
        {
            this.suite = suite;
            backtrace = new List<BacktraceFrame>();

            errorType = attributes["type"].Value;
            line = int.Parse(attributes["line"].Value);

            suite.AddChild(this);
        }
コード例 #2
0
        public TestCaseResult(TestSuiteResult suite,
			XmlAttributeCollection attributes)
        {
            this.suite = suite;
            assertions = new List<ITestAssertion>();

            name = attributes["name"].Value;
            line = int.Parse(attributes["line"].Value);

            suite.AddChild(this);
        }
コード例 #3
0
        private void ProcessTest(TestSuiteResult suite, XmlNode testNode)
        {
            TestCaseResult testCase = new TestCaseResult(suite, testNode.Attributes);

            foreach (XmlNode child in testNode.ChildNodes)
            {
                ITestAssertion assertion = TestAssertionFactory.Create(
                    testCase, child.Name, child.Attributes);

                if(assertion is AssertionWithStackTrace)
                {
                    AssertionWithStackTrace ast = (AssertionWithStackTrace)assertion;

                    ast.SetMessage(child.InnerText);

                    foreach (XmlNode child2 in child.ChildNodes)
                    {
                        if (child2.Name == "stack-frame")
                        {
                            BacktraceFrame frame = ProcessStackFrame(child2);
                            ast.AddBacktraceFrame(frame);
                        }
                    }
                }
            }
        }
コード例 #4
0
        private void ProcessSuiteError(TestSuiteResult suite, XmlNode errorNode)
        {
            TestSuiteErrorResult error = new TestSuiteErrorResult(suite, errorNode.Attributes);
            error.Message = errorNode.InnerText;

            foreach (XmlNode child in errorNode.ChildNodes)
            {
                if(child.Name == "stack-frame")
                {
                    BacktraceFrame frame = ProcessStackFrame(child);
                    error.AddBacktraceFrame(frame);
                }
            }
        }
コード例 #5
0
        private void ProcessSuite(XmlNode suiteNode)
        {
            TestSuiteResult suite = new TestSuiteResult(suiteNode.Attributes);
            suiteResults.Add(suite);

            foreach (XmlNode child in suiteNode.ChildNodes)
            {
                if (child.Name == "suite-error")
                    ProcessSuiteError(suite, child);
                else if (child.Name == "test")
                    ProcessTest(suite, child);
            }
        }