public void RemoveErroneousIdKeyFeature() { using (var db = new EntitesContext()) { kfDAO = new DbKeyFeatureDAO(db); Assert.ThrowsException <ArgumentException>(() => kfDAO.Remove(erroneousId)); } }
public bool Remove(int id) { if (id < 1) { throw new ArgumentException(nameof(id)); } return(keyFeatureDAO.Remove(id)); }
public void RemoveNoDBKeyFeature() { using (var db = new EntitesContext()) { ClearTable.KeyFeatures(db); kfDAO = new DbKeyFeatureDAO(db); kfDAO.Add(CreateNew()); Assert.IsFalse(kfDAO.Remove(123)); } }
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); }