public async Task DownloadPage(string page) { Console.WriteLine($"\tDownload {page}"); string response = await wiki.GetHtmlAsync(page); await file.SaveToFileAsync(page, response); }
public void ShouldDownloadPage() { // Arrange linkService = new LinksServices(db, file, wiki); string page = "page_name"; wiki.GetHtmlAsync(page).Returns("http page");; // Act linkService.DownloadPage(page).Wait(); // Assert wiki.Received(1).GetHtmlAsync(page); file.Received(1).SaveToFileAsync(page, "http page"); }