Ejemplo n.º 1
0
        public GenerateScreenshotMessageHandlerTests()
        {
            var webDriverFactory = Substitute.For <IWebDriverFactory>();
            var webDriver        = Substitute.For <IWebDriver, ITakesScreenshot>();

            _navigation = Substitute.For <INavigation>();
            webDriver.Navigate().Returns(_navigation);
            _screenshot = new OpenQA.Selenium.Screenshot("iVBORw0KGgoA");
            ((ITakesScreenshot)webDriver).GetScreenshot().Returns(_screenshot);
            webDriverFactory.Create().Returns(webDriver);
            _saveScreenshotCommand = Substitute.For <ISaveScreenshotCommand>();
            _message = new GenerateScreenshotMessage("http://abc.se");
            _sut     = new GenerateScreenshotMessageHandler(webDriverFactory, _saveScreenshotCommand);
        }
 public GenerateScreenshotMessageHandler(IWebDriverFactory webDriverFactory, ISaveScreenshotCommand saveScreenshotCommand)
 {
     _webDriverFactory      = webDriverFactory;
     _saveScreenshotCommand = saveScreenshotCommand;
 }