private async Task TearDown() { foreach (City listCity1 in listCity) { List <City> list = dictionaryStorage.CitiesGetAll().Result; await dictionaryStorage.CityDelete((int)listCity1.Id); List <City> list1 = dictionaryStorage.CitiesGetAll().Result; Assert.AreEqual(list.Count - 1, list1.Count); Assert.False(list1.Contains(listCity1)); } }
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); }
public async Task <ActionResult <List <City> > > GetAllCities() { List <City> cities = await dictionaryStorage.CitiesGetAll(); return(Ok(CityMapper.ToOutputModels(cities))); }