public async Task Given_A_CardsByArchetype_Article_Should_Execute_ArchetypeCardsService_Update() { // Arrange var article = new UnexpandedArticle { Title = "Clear Wing", Url = "/wiki/List_of_\"Clear_Wing\"_cards" }; _config.WikiaDomainUrl.Returns("http://yugioh.wikia.com"); _archetypeService.ArchetypeByName(Arg.Any <string>()).Returns(new Archetype()); _archetypeWebPage.Cards(Arg.Any <Uri>()).Returns(new List <string> { "Blue-Eyes White Dragon" }); _archetypeCardsService.Update(Arg.Any <UpdateArchetypeCardsCommand>()).Returns((IEnumerable <ArchetypeCard>)null); // Act await _sut.ProcessItem(article); // Assert await _archetypeCardsService.Received(1).Update(Arg.Any <UpdateArchetypeCardsCommand>()); }
public async Task Given_An_ArchetypeCardMessage_If_Archetype_Is_Found_Should_Invoke_Update_Method_Once() { // Arrange var archetypeCardMessage = new ArchetypeCardMessage { ArchetypeName = "Blue-Eyes White Dragon", Cards = new List <string> { "Blue-Eyes White Dragon" } }; _archetypeService.ArchetypeByName(Arg.Any <string>()).Returns(new Archetype()); // Act await _sut.Process(archetypeCardMessage); // Assert await _archetypeCardsService.Received(1).Update(Arg.Any <long>(), Arg.Any <IEnumerable <string> >()); }