Beispiel #1
0
        private void LoadObjectModelTestCaseAndInit(BizUnitTestCase testCase, TestGroupPhase phase, Context ctx)
        {
            if (null != ctx)
            {
                _context = ctx;
                _context.Initialize(this);
            }
            else
            {
                _context = new Context(this);
                _logger = _context.Logger;
            }

            _testGroupPhase = phase;
            _testName = testCase.Name;
            DateTime now = DateTime.Now;

            if (phase == TestGroupPhase.Unknown)
            {
                _logger.TestStart(_testName, now, GetUserName());                
                _context.Add(BizUnitTestCaseStartTime, now);
            }
            else
            {
                _logger.TestGroupStart(_testName, phase, now, GetUserName());
            }

            _testCaseObjectModel = testCase;
        }
Beispiel #2
0
        private void Init(
            XmlDocument testConfig, TestGroupPhase phase, Context ctx)
        {
            if (null != ctx)
            {
                _context = ctx;
                _context.Initialize(this);
            }
            else
            {
                _context = new Context(this);
                _logger = _context.Logger;
            }

            _testGroupPhase = phase;

            // Get test name...
            XmlNode nameNode = testConfig.SelectSingleNode("/TestCase/@_testName");
            if (null != nameNode)
            {
                _testName = nameNode.Value;
                _context.Add(BizUnitTestCaseName, _testName, true);
            }

            DateTime now = DateTime.Now;

            if (phase == TestGroupPhase.Unknown)
            {
                _logger.TestStart(_testName, now, GetUserName());
                _context.Add(BizUnitTestCaseStartTime, now, true);
            }
            else
            {
                _logger.TestGroupStart(_testName, phase, now, GetUserName());
            }

            // Get test setup / execution / teardown steps
            _setupSteps = testConfig.SelectNodes("/TestCase/TestSetup/*");
            _executeSteps = testConfig.SelectNodes("/TestCase/TestExecution/*");
            _teardownSteps = testConfig.SelectNodes("/TestCase/TestCleanup/*");
        }
Beispiel #3
0
        private void LoadXamlTestCaseAndInit(TestCase testCase, TestGroupPhase phase, Context ctx)
        {
            ArgumentValidation.CheckForNullReference(testCase, "testCase");
            // ctx - optional

            if (null != ctx)
            {
                _context = ctx;
                _context.Initialize(this);
            }
            else
            {
                _context = new Context(this);
                _logger = _context.Logger;
            }

            _xamlTestCase = testCase;
            _testGroupPhase = phase;
            _testName = testCase.Name;
            DateTime now = DateTime.Now;

            // Validate test case...
            testCase.Validate(_context);

            if (phase == TestGroupPhase.Unknown)
            {
                _logger.TestStart(_testName, now, GetUserName());
                _context.Add(BizUnitTestCaseStartTime, now, true);
            }
            else
            {
                _logger.TestGroupStart(testCase.Name, phase, now, GetUserName());
            }
        }