Пример #1
0
        public void DeleteCounty_ValidCounty()
        {
            var county1        = _countyDal.GetCountyById(1);
            int a              = _listOfCountiesModelDC.Count;
            var county1ModelDC = _listOfCountiesModelDC.Find(x => x.countyId == county1.countyId);

            _countyDal.DeleteCounty(county1.countyId);
            _listOfCountiesModelDC.Remove(county1ModelDC);
            int b = _listOfCountiesModelDC.Count;

            Assert.AreNotEqual(a, b);
        }
Пример #2
0
        public void DeleteCounty(int id)
        {
            if (id < 0)
            {
                throw new ArgumentException(Messages.CountyExceptionDelete);
            }

            foreach (CountyModelDC county in _counties.GetCounties())
            {
                if (county.countyId == id)
                {
                    _counties.DeleteCounty(id);
                }
            }
        }