public void DeleteCity_ValidCity()
        {
            var city1        = _cityDal.GetCityById(1);
            int a            = _listOfCitiesModelDC.Count;
            var city1ModelDC = _listOfCitiesModelDC.Find(x => x.cityId == city1.cityId);

            _cityDal.DeleteCity(city1.cityId);
            _listOfCitiesModelDC.Remove(city1ModelDC);
            int b = _listOfCitiesModelDC.Count;

            Assert.AreNotEqual(a, b);
        }
Beispiel #2
0
        public void DeleteCity(int id)
        {
            if (id < 0)
            {
                throw new ArgumentException(Messages.CityExceptionDelete);
            }

            foreach (CityModelDC city in _cityDAL.GetCities())
            {
                if (city.cityId == id)
                {
                    _cityDAL.DeleteCity(id);
                }
            }
        }