コード例 #1
0
        static void Main(string[] args)
        {
            var tc1Step1 = new TestStepResult("Test step 1", true);
            var tc2step2 = new TestStepResult("Test step 2", false);
            var tc3step3 = new TestStepResult("Test step 3", true);

            TestStepResults results = new TestStepResults();

            results.Add(tc1Step1);
            results.Add(tc2step2);
            results.Add(tc3step3);

            TestCaseResult caseresult = new TestCaseResult("a sample description");

            TestCaseResults caseresults = new TestCaseResults();

            TestRun run = new TestRun("25/2/2020", "RETRER2134", "12345");
        }
コード例 #2
0
        private TestStepResults GetListOfTestStepResult(XmlNode node)
        {
            TestStepResults listOfTestStepResult = new TestStepResults();
            XmlNodeList     testStepResultNodes  = node.ChildNodes;

            foreach (XmlNode resNode in testStepResultNodes)
            {
                string         desc           = resNode.SelectSingleNode("Description").InnerText;
                string         passed         = resNode.SelectSingleNode("Passed").InnerText;
                bool           val            = (passed == "True") ? true : false;
                TestStepResult testStepResult = new TestStepResult(desc, val);
                listOfTestStepResult.Add(testStepResult);
            }
            return(listOfTestStepResult);
        }
コード例 #3
0
        private TestRun GetFailedTestRunObj(List <TestCaseResult> failedTestCases)
        {
            _testRunFailed = new TestRun("13:23:34 3-3-2020", "INGHTBGFTR", "sdr01");
            TestCaseResults testCaseResults = new TestCaseResults();

            foreach (var testcase in failedTestCases)
            {
                TestCaseResult  testcaseRes     = new TestCaseResult(testcase.getTestCaseName());
                TestStepResults testStepResults = new TestStepResults();
                foreach (var testStepResult in testcase.GetAllTestStepResults().GetTestStepResults())
                {
                    bool isPassed = testStepResult.IsPassed();
                    if (!isPassed)
                    {
                        testStepResults.Add(testStepResult);
                    }
                }
                testcaseRes.Add(testStepResults);
                testCaseResults.Add(testcaseRes);
            }
            _testRunFailed.Add(testCaseResults);
            return(_testRunFailed);
        }