1
注意>国家/地区表中的记录数:36条记录。存储库测试不会返回预计的实体数量
我的代码:
[TestFixture]
public class CountriesControllerTest
{
Mock<IJN_CountryRepository> countryRepository;
Mock<IUnitOfWork> unitOfWork;
IJN_CountryService countryService;
[SetUp]
public void SetUp()
{
countryRepository = new Mock<IJN_CountryRepository>();
unitOfWork = new Mock<IUnitOfWork>();
countryService = new JN_CountryService(countryRepository.Object, unitOfWork.Object);
}
[Test]
public void ManyDelete()
{
var count = countryService.GetCount();
// Assert
Assert.AreEqual(36, count);
}
}
NUnit测试消息:
为什么?为什么不读取记录的数量?