Example #1
0
        public async Task TestBackAsyncCache()
        {
            BrowserStandard browser = new BrowserStandard();
            IDocument       firstResponseDocument = browser.Navigate("http://google.com");

            Assert.True(firstResponseDocument == browser.Document);
            Assert.True(browser.History.Count == 1);
            browser.Navigate("https://facebook.com");
            Assert.True(browser.History.Count == 2);
            await browser.BackAsync(true);

            Assert.True(browser.History.Count == 1);
            Assert.True(browser.ForwardHistory.Count == 1);
            Assert.True(browser.Document == firstResponseDocument);
        }
Example #2
0
        public async Task TestForwardAsyncCache()
        {
            BrowserStandard browser = new BrowserStandard();
            IDocument       firstResponseDocument = await browser.NavigateAsync("http://google.com");

            Assert.True(firstResponseDocument == browser.Document);
            Assert.True(browser.History.Count == 1);
            IDocument secondDocument = await browser.NavigateAsync("https://facebook.com");

            Assert.True(browser.History.Count == 2);
            await browser.BackAsync();

            Assert.True(browser.History.Count == 1);
            Assert.True(browser.ForwardHistory.Count == 1);
            Assert.True(browser.Document != firstResponseDocument);
            Assert.True(browser.Document.Response.ResponseUri == firstResponseDocument.Response.ResponseUri);

            await browser.ForwardAsync();

            Assert.True(browser.ForwardHistory.Count == 0);
            Assert.True(browser.History.Count == 2);
            Assert.True(secondDocument.Response.ResponseUri == browser.Document.Response.ResponseUri);
        }