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(); }
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(); }
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(); }
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(); }
public void TearDown() { browser.Close(); }