public async Task Given_A_CategoryList_And_PageSize_Should_Invoke_Producer_Method_3_Times() { // Arrange const int expected = 3; var categories = new List <string> { "category1", "category2", "category3" }; const int pageSize = 10; // Act await _sut.Process(categories, pageSize); // Assert await _articleCategoryDataSource.Received(expected).Producer(Arg.Any <string>(), Arg.Any <int>()).ToListAsync(); }
public async Task Given_A_Category_And_PageSize_Should_Invoke_Producer_Method_Once() { // Arrange const string category = "category"; const int pageSize = 10; // Act await _sut.Process(category, pageSize); // Assert await _articleCategoryDataSource.Received(1).Producer(Arg.Any <string>(), Arg.Any <int>()).ToListAsync(); }