Ejemplo n.º 1
0
        private void CityTestSelects()
        {
            List <City> cityActual = dictionaryStorage.CitiesGetAll().Result;

            for (int i = 0; i < listCity.Count; i++)
            {
                Assert.Contains(listCity[i], cityActual);
            }

            City actualCity = dictionaryStorage.CityGetByID((int)listCity[0].Id).Result;

            Assert.AreEqual(listCity[0], actualCity);
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <City> > GetCityByID(int id)
        {
            if (id <= 0)
            {
                return(BadRequest());
            }
            City city = await dictionaryStorage.CityGetByID(id);

            return(Ok(CityMapper.ToOutputModel(city)));
        }