public void TestInitialize()
 {
     townRepository.Setup(x => x.GetAll()).Returns(towns.AsQueryable());
     townRepository.Setup(x => x.GetAllList()).Returns(townRepository.Object.GetAll().ToList());
     townRepository.Setup(x => x.Count()).Returns(townRepository.Object.GetAll().Count());
     townRepository.MockRemoveOneTownOperation();
     controller = new RegionController(townRepository.Object,null, null, null);
     helper = new RegionAndDeleteTownTestHelper(controller, townRepository.Object);
 }
示例#2
0
 public void TestInitialize()
 {
     townRepository.Setup(x => x.GetAll()).Returns(towns.AsQueryable());
     townRepository.Setup(x => x.GetAllList()).Returns(townRepository.Object.GetAll().ToList());
     townRepository.Setup(x => x.Count()).Returns(townRepository.Object.GetAll().Count());
     townRepository.MockRemoveOneTownOperation();
     controller = new RegionController(townRepository.Object, null, null, null);
     helper     = new RegionAndDeleteTownTestHelper(controller, townRepository.Object);
 }