public async Task Given_A_Valid_Article_Should_Execute_GetYugiohCard() { // Arrange var article = new UnexpandedArticle { Title = "Blue-Eyes", Url = "/wiki/Blue-Eyes" }; _config.WikiaDomainUrl.Returns("http://yugioh.wikia.com"); _cardWebPage.GetYugiohCard(Arg.Any <string>()).Returns((YugiohCard)null); // Act await _sut.ProcessItem(article); // Assert _cardWebPage.Received(1).GetYugiohCard(Arg.Any <Uri>()); }
public async Task Given_An_Article_Should_Invoke_GetYugiohCard_Once() { // Arrange var article = new Article { Id = 3242423 }; _yugiohCardQueue.Publish(Arg.Any <ArticleProcessed>()).Returns(new YugiohCardCompletion { Article = article, IsSuccessful = true }); // Act await _sut.ProcessDataFlow(article); // Assert _cardWebPage.Received(1).GetYugiohCard(Arg.Is(article)); }