Exemplo n.º 1
0
        public async Task CanCrawlSimpleSite()
        {
            restClientMock.GetAsync(new Uri("http://simplesite.com")).Returns(FileHelper.GetSiteFromFile(@"Examples\SimpleSite\simplesite_home.html"));
            restClientMock.GetAsync(new Uri("http://simplesite.com/about")).Returns(FileHelper.GetSiteFromFile(@"Examples\SimpleSite\simplesite_about.html"));
            restClientMock.GetAsync(new Uri("http://simplesite.com/contact")).Returns(FileHelper.GetSiteFromFile(@"Examples\SimpleSite\simplesite_contact.html"));
            restClientMock.GetAsync(new Uri("http://simplesite.com/hiring")).Returns(FileHelper.GetSiteFromFile(@"Examples\SimpleSite\simplesite_hiring.html"));

            await sut.Execute("http://simplesite.com");

            Assert.That(sut.GetWebsiteMap().Count, Is.EqualTo(4));
        }