public void RemoveErroneousIdKeyFeatureClient()
 {
     using (var db = new EntitesContext())
     {
         kfcDAO = new DbKeyFeatureClientDAO(db);
         Assert.ThrowsException <ArgumentException>(() => kfcDAO.Remove(erroneousId));
     }
 }
Ejemplo n.º 2
0
        public bool Remove(int id)
        {
            if (id < 1)
            {
                throw new ArgumentException(nameof(id));
            }

            return(keyFeatureClientDAO.Remove(id));
        }
 public void RemoveNoDBHaspKey()
 {
     using (var db = new EntitesContext())
     {
         ClearTable.HaspKeys(db);
         kfcDAO = new DbKeyFeatureClientDAO(db);
         kfcDAO.Add(CreateNew());
         Assert.IsFalse(kfcDAO.Remove(12));
     }
 }
        public void RemoveKeyFeatureClient()
        {
            bool remove;

            using (var db = new EntitesContext())
            {
                ClearTable.KeyFeatureClients(db);

                kfcDAO = new DbKeyFeatureClientDAO(db);
                db.KeyFeatureClients.AddRange(CreateListEntities.KeyFeatureClients());
                db.SaveChanges();

                remove = kfcDAO.Remove(1);
            }

            Assert.IsTrue(remove);
        }