Ejemplo n.º 1
0
        public async Task Given_A_Valid_Article_Should_Process_Article_Successfully()
        {
            // Arrange
            var article = new UnexpandedArticle();

            // Act
            var result = await _sut.ProcessItem(article);

            // Assert
            result.IsSuccessfullyProcessed.Should().BeTrue();
        }
Ejemplo n.º 2
0
        public async Task Given_An_Archetype_Article_Should_Execute_ArchetypeByName()
        {
            // Arrange
            var article = new UnexpandedArticle {
                Title = "Blue-Eyes", Url = "/wiki/Blue-Eyes"
            };

            _config.WikiaDomainUrl.Returns("http://yugioh.wikia.com");
            _archetypeWebPage.Cards(Arg.Any <Uri>()).Returns(new List <string> {
                "Blue-Eyes White Dragon"
            });
            _archetypeService.Add(Arg.Any <AddArchetypeCommand>()).Returns(new Archetype());

            // Act
            await _sut.ProcessItem(article);

            // Assert
            await _archetypeService.Received(1).ArchetypeById(Arg.Any <int>());
        }