コード例 #1
0
        public void TestClosesDoenNothingWhenDriverIsNotInitialized()
        {
            var driver = new Mock <IWebDriver>(MockBehavior.Strict);

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

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

            browser.Close();

            driver.VerifyAll();
        }
コード例 #2
0
        public void TestClosesBrowserWhenDriverIsInitialized()
        {
            var driver = new Mock <IWebDriver>(MockBehavior.Strict);

            driver.Setup(d => d.Close());

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

            Assert.IsNotNull(lazyDriver.Value);

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

            var browser = new SeleniumBrowser(lazyDriver, logger.Object);

            browser.Close();

            driver.VerifyAll();
        }
コード例 #3
0
        public void TestClosesDoenNothingWhenDriverIsNotInitialized()
        {
            var driver = new Mock<IWebDriver>(MockBehavior.Strict);

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

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

            browser.Close();

            driver.VerifyAll();
        }
コード例 #4
0
        public void TestClosesBrowserWhenDriverIsInitialized()
        {
            var driver = new Mock<IWebDriver>(MockBehavior.Strict);
            driver.Setup(d => d.Close());

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

            Assert.IsNotNull(lazyDriver.Value);

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

            var browser = new SeleniumBrowser(lazyDriver, logger.Object);

            browser.Close();

            driver.VerifyAll();
        }
コード例 #5
0
 public void TearDown()
 {
     browser.Close();
 }