예제 #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();
        }
        public async Task Given_An_Invalid_Banlist_Article_Should_Not_Execute_Update_AddOrUpdate_Method()
        {
            // Arrange
            var article = new UnexpandedArticle {
                Title = "January 2018 Lists", Url = "/wiki/January_2018_Lists"
            };

            var expandedArticleResultSet = new ExpandedArticleResultSet {
                Items = new Dictionary <string, ExpandedArticle>()
            };

            expandedArticleResultSet.Items.Add("test", new ExpandedArticle {
                Id = 23422, Abstract = string.Empty
            });
            _wikiArticle.Details(Arg.Any <int>()).Returns(expandedArticleResultSet);

            // Act
            await _sut.ProcessItem(article);

            // Assert
            await _yugiohBanlistService.DidNotReceive().AddOrUpdate(Arg.Any <YugiohBanlist>());
        }