public void TestTearDownAfterScenarioWhenReuseBrowserIsTrue() { // arrange BrowserFactoryConfiguration config = new BrowserFactoryConfiguration { ReuseBrowser = true }; var browserFactory = new Mock <BrowserFactory>(config); WebDriverSupport.SetBrowserFactory(browserFactory.Object); var browser = new Mock <IBrowser>(MockBehavior.Loose); WebDriverSupport.SetCurrentBrowser(browser.Object); // act WebDriverSupport.TearDownAfterScenario(); // assert browser.Verify(b => b.Close(true), Times.Never()); }
public void TestTearDownAfterScenarioWhenReuseBrowserIsTrue() { // arrange var config = new ConfigurationSectionHandler { BrowserFactory = new BrowserFactoryConfigurationElement { ReuseBrowser = true } }; var browser = new Mock <IBrowser>(MockBehavior.Loose); WebDriverSupport.Browser = browser.Object; WebDriverSupport.ConfigurationMethod = new Lazy <ConfigurationSectionHandler>(() => config); // act WebDriverSupport.TearDownAfterScenario(); // assert browser.Verify(b => b.Close(true), Times.Never()); }