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測試消息:
爲什麼?爲什麼不讀取記錄的數量?