Ejemplo n.º 1
0
        public void TestGotoPageCallsDriverMethod()
        {
            var url = new Uri("http://www.bing.com");

            var navigation = new Mock<INavigation>(MockBehavior.Strict);
            navigation.Setup(n => n.GoToUrl(url));

            var driver = new Mock<IWebDriver>(MockBehavior.Strict);
            driver.Setup(d => d.Navigate()).Returns(navigation.Object);

            var browser = new SeleniumBrowser(new Lazy<IWebDriver>(() => driver.Object));

            browser.GoTo(url);

            driver.VerifyAll();
            navigation.VerifyAll();
        }
Ejemplo n.º 2
0
        public void TestGotoPageCallsDriverMethod()
        {
            var url = new Uri("http://www.bing.com");

            var navigation = new Mock <INavigation>(MockBehavior.Strict);

            navigation.Setup(n => n.GoToUrl(url));

            var driver = new Mock <IWebDriver>(MockBehavior.Strict);

            driver.Setup(d => d.Navigate()).Returns(navigation.Object);

            var logger = new Mock <ILogger>(MockBehavior.Loose);

            var browser = new SeleniumBrowser(new Lazy <IWebDriver>(() => driver.Object), logger.Object);

            browser.GoTo(url);

            driver.VerifyAll();
            navigation.VerifyAll();
        }