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()); controller = new RegionController(townRepository.Object, null, null, null); helper = new RegionAndAddTownTestHelper(controller, townRepository.Object); }