示例#1
0
        public async Task Given_A_Category_And_An_Article_Should_Invoke_ProcessItem_Method_Once()
        {
            // Arrange
            const int    expected = 1;
            const string category = "category";

            // Act
            await _sut.Process(category, new UnexpandedArticle());

            // Assert
            await _processor.Received(expected).ProcessItem(Arg.Any <UnexpandedArticle>());
        }
        public async Task Given_A_Category_And_An_Article_Should_Invoke_ProcessItem_Method_Once()
        {
            // Arrange
            const int    expected = 1;
            const string category = "category";

            _processor.Handles(Arg.Any <string>()).Returns(true);
            _processor.ProcessItem(Arg.Any <Article>()).Returns(new ArticleTaskResult());

            // Act
            await _sut.Process(category, new Article());

            // Assert
            await _processor.Received(expected).ProcessItem(Arg.Any <Article>());
        }