public ActionResult Details(int id)
        {
            var region = _placesService.GetRegionById(id);

            if (region == null)
            {
                AddMessageToTempData(CommonResources.NoDataFound, BusinessSolutions.MVCCommon.MessageType.Error);
                return(RedirectToAction("Index"));
            }

            return(View(region));
        }
Exemple #2
0
        public void UpdateRegion_WithValidData_UpdateRegionData()
        {
            var region = new RegionViewModel
            {
                RegionId  = PlaceServiceTestCases.Region.RegionId,
                CountryId = PlaceServiceTestCases.Region.CountryId,
            };

            region.RegionName   = "UpdatedRegionName";
            region.RegionCode   = "Updated1";
            region.RegionNameEn = "UpdatedRegionNameEn";

            var result = _placesServices.UpdateRegion(region);

            var currentRegion = _placesServices.GetRegionById(region.RegionId);

            result.Succeeded.Should().Be(true);
            currentRegion.RegionName.Should().Be(region.RegionName);
            currentRegion.RegionNameEn.Should().Be(region.RegionNameEn);
            currentRegion.RegionCode.Should().Be(region.RegionCode);
        }