// ToDo: Figure out why the mock setup for DistrictRepository.DeleteDistrict() is not being mocked correctly //[TestMethod] public void DeleteDistrict() { // Arrange var district = _districtSeeder.Objects[0]; Mock.Get(_repositoryWrapper.District).Setup(x => x.DeleteDistrict(district)); Mock.Get(_repositoryWrapper.District).Setup(x => x.GetDistrictById(district.Id)).ReturnsAsync(district); Mock.Get(_repositoryWrapper.DistrictSchool).Setup(x => x.DistrictSchoolsByDistrict(district.Id)).ReturnsAsync(new List <DistrictSchool>()); var controller = new DistrictController(_loggerManager, _mapper, _repositoryWrapper); // Act var actionResult = controller.DeleteDistrict(district.Id).Result; // Assert var noContentResult = actionResult as NoContentResult; Assert.IsNotNull(noContentResult); }