public ActionResult Details(int id) { var item = _placesService.GetCountryById(id); if (item == null) { AddMessageToTempData(CommonResources.NoDataFound, BusinessSolutions.MVCCommon.MessageType.Error); return(RedirectToAction("Index")); } return(View(item)); }
public void GetCountryById_WithZeroAndOne_GetNullAndThenCountry([Values(0, 1)] int countryId) { var country = _placesServices.GetCountryById(countryId); if (countryId == 0) { country.Should().BeNull(); } else { country.Should().NotBeNull(); country.CountryId.Should().Be(countryId); } }