我正在实施以下测试:
[TestMethod]
public void Index_Get_RetrievesAllContributionsFromRepository()
{
// Arrange
Contributions Contribution1 = GetContributionNamed("Council", 2003);
Contributions Contribution2 = GetContributionNamed("Council", 2004);
InMemoryContributionRepository repository = new InMemoryContributionRepository();
repository.Add(Contribution1);
repository.Add(Contribution2);
var controller = GetHomeController(repository);
// Act
var result = controller.Index();
// Assert
var model = (IEnumerable<Contributions>)result.ViewData.Model;
CollectionAssert.Contains(model.ToList(), Contribution1);
CollectionAssert.Contains(model.ToList(), Contribution2);
CollectionAssert.xxxxxx(model.ToList().Count, Contribution1, 2);
}
xxxxxx 的最后一个测试是尝试检查是否Contribution1
有 2 个值,它确实如此。请问哪行代码执行该测试?
c#新手