Пример #1
0
        public async Task Given_A_Valid_Article_If_The_Title_Equals_Archetype_Should_Not_Invoke_WikiaArticle_Details_Method()
        {
            // Arrange
            var article = new Article
            {
                CorrelationId = Guid.NewGuid(),
                Id            = 909890,
                Title         = "Archetype",
                Url           = "http://yugioh.wikia.com/wiki/Blue-Eyes"
            };

            // Act
            await _sut.Process(article);

            // Assert
            await _wikiArticle.DidNotReceive().Details(Arg.Any <int>());
        }
        public async Task Given_An_Invalid_Banlist_Article_Should_Not_Execute_WikiArticle_Simple_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 _wikiArticle.DidNotReceive().Simple(Arg.Any <int>());
        }