// GET: Settings/Cities public ActionResult Index(SearchCityViewModel searchCityModel) { var result = _placesService.GetCities(searchCityModel); searchCityModel.Items = new StaticPagedList <CityViewModel>(result.Items , searchCityModel.PageIndex + 1, searchCityModel.PageSize, result.TotalCount); return(View(searchCityModel)); }
public void GetCities_WithValidParamters_ReturnExpectedResult(string cityName, string cityCode , int pageIndex, int pageSize , int expectedItemsCount, int expectedTotalCounts) { var searchViewModel = new SearchCityViewModel(3) { CityName = cityName, CityCode = cityCode, CountryId = PlaceServiceTestCases.Country.CountryId, }; var searchResult = _placesServices.GetCities(searchViewModel); searchResult.Items.Should().HaveCount(expectedItemsCount); searchResult.TotalCount.Should().Be(expectedTotalCounts); }