예제 #1
0
 public void RemoveErroneousIdKeyFeature()
 {
     using (var db = new EntitesContext())
     {
         kfDAO = new DbKeyFeatureDAO(db);
         Assert.ThrowsException <ArgumentException>(() => kfDAO.Remove(erroneousId));
     }
 }
예제 #2
0
        public bool Remove(int id)
        {
            if (id < 1)
            {
                throw new ArgumentException(nameof(id));
            }

            return(keyFeatureDAO.Remove(id));
        }
예제 #3
0
 public void RemoveNoDBKeyFeature()
 {
     using (var db = new EntitesContext())
     {
         ClearTable.KeyFeatures(db);
         kfDAO = new DbKeyFeatureDAO(db);
         kfDAO.Add(CreateNew());
         Assert.IsFalse(kfDAO.Remove(123));
     }
 }
예제 #4
0
        public void RemoveKeyFeature()
        {
            bool remove;

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

                kfDAO = new DbKeyFeatureDAO(db);
                db.KeyFeatures.AddRange(CreateListEntities.KeyFeatures());
                db.KeyFeatureClients.AddRange(CreateListEntities.KeyFeatureClients());
                db.SaveChanges();

                remove = kfDAO.Remove(1);
            }

            Assert.IsTrue(remove);
        }