Пример #1
0
        public void FireMustPass()
        {
            var webDriver = new Mock <IWebDriver>();
            var navigate  = new Mock <INavigation>();

            webDriver.Setup(x => x.Navigate()).Returns(navigate.Object);

            _driver.Setup(x => x.SeleniumWebDriver).Returns(webDriver.Object);

            var testCase1 = new Mock <ITestCase>();
            var testCase2 = new Mock <ITestCase>();
            var testStep  = new Mock <ITestStep>();

            testStep.Setup(x => x.Do).Returns(ActivityTypes.Navigate.Name);
            testStep.Setup(x => x.Argument).Returns("https://www.google.com");

            testCase1.Setup(x => x.Steps).Returns(new List <ITestStep> {
                testStep.Object
            });
            testCase2.Setup(x => x.Steps).Returns(new List <ITestStep> {
                testStep.Object
            });

            var testCases = new List <ITestCase> {
                testCase1.Object, testCase2.Object
            };

            var engine = new TestExecutionEngine(_driver.Object, _reporter.Object);

            engine.AddTestCases(testCases.ToArray());

            var result = engine.Fire();

            Assert.NotNull(result);
        }
Пример #2
0
        public void AddTestCasesMustPass()
        {
            var testCase1 = new Mock <ITestCase>();
            var testCase2 = new Mock <ITestCase>();

            var testCases = new List <ITestCase> {
                testCase1.Object, testCase2.Object
            };

            var engine = new TestExecutionEngine(_driver.Object, _reporter.Object);
            var result = engine.AddTestCases(testCases.ToArray());

            Assert.NotNull(result);
        }
Пример #3
0
        public void AddTestCasesNullCheck()
        {
            var engine = new TestExecutionEngine(_driver.Object, _reporter.Object);

            Assert.Throws <ArgumentNullException>(() => engine.AddTestCases(null));
        }