public void RemoveErroneousIdKeyFeature() { using (var db = new EntitesContext()) { keyFeatureL = Get(db); Assert.ThrowsException <ArgumentException>(() => keyFeatureL.Remove(erroneousId)); } }
public void RemoveNoDBKeyFeature() { using (var db = new EntitesContext()) { ClearTable.KeyFeatures(db); keyFeatureL = Get(db); keyFeatureL.Save(CreateNew()); Assert.IsFalse(keyFeatureL.Remove(123)); } }
public void RemoveKeyFeature() { bool remove; using (var db = new EntitesContext()) { ClearTable.KeyFeatures(db); ClearTable.KeyFeatureClients(db); keyFeatureL = Get(db); db.KeyFeatures.AddRange(CreateListEntities.KeyFeatures()); db.KeyFeatureClients.AddRange(CreateListEntities.KeyFeatureClients()); db.SaveChanges(); remove = keyFeatureL.Remove(1); } Assert.IsTrue(remove); }
public bool Remove(IEnumerable <int> idFeatureKey, out string error) { if (idFeatureKey == null) { throw new ArgumentNullException(nameof(idFeatureKey)); } error = string.Empty; foreach (var id in idFeatureKey) { if (!keyFeatureLogic.Remove(id)) { error += errorDelete + id.ToString() + '\n'; } } return(string.IsNullOrEmpty(error)); }