public void UpdateDistrict() { // Arrange var districtDto = new DistrictDto { Name = "Update District 1" }; var district = _mapper.Map <District>(districtDto); district.Id = Guid.NewGuid(); Mock.Get(_repositoryWrapper.District).Setup(x => x.UpdateDistrict(district, district)); Mock.Get(_repositoryWrapper.District).Setup(x => x.GetDistrictById(district.Id)).ReturnsAsync(district); var controller = new DistrictController(_loggerManager, _mapper, _repositoryWrapper); // Act var actionResult = controller.UpdateDistrict(district.Id, districtDto).Result; // Assert var noContentResult = actionResult as NoContentResult; Assert.IsNotNull(noContentResult); }