Exemplo n.º 1
0
        public void BrowserHandler_OnLoadError_UrlDoesNotContainStudioHomePage_RedirectsToServerDisconnected()
        {
            var browser = new Mock <IWebBrowser>();

            browser.Setup(b => b.Load(It.Is <string>(s => s.EndsWith(StringResources.Uri_Studio_PageMissing)))).Verifiable();

            var popupController = new Mock <IBrowserPopupController>();

            var handler   = new BrowserHandler(popupController.Object);
            var errorText = "Not found";
            var result    = handler.OnLoadError(browser.Object, "myfake.url", 404, ref errorText);

            Assert.IsTrue(result);
            browser.Verify(b => b.Load(It.Is <string>(s => s.EndsWith(StringResources.Uri_Studio_PageMissing))), Times.Once());
        }