public void UpdateNullKeyFeature() { using (var db = new EntitesContext()) { keyFeatureL = Get(db); Assert.ThrowsException <ArgumentNullException>(() => keyFeatureL.Update(null)); } }
public void UpdateDuplicateKeyKeyFeature() { bool update; var keyFeature = CreateNew(); using (var db = new EntitesContext()) { ClearTable.KeyFeatures(db); keyFeatureL = Get(db); keyFeatureL.Save(keyFeature); keyFeature.IdFeature = 111; update = keyFeatureL.Update(CreateNew(2)); } Assert.IsFalse(update); }
public void UpdateNoDBKeyFeature() { var kfNoDB = new KeyFeature { Id = 32, IdFeature = 3, IdHaspKey = 24, EndDate = date.AddDays(100), StartDate = date, }; using (var db = new EntitesContext()) { ClearTable.KeyFeatures(db); keyFeatureL = Get(db); keyFeatureL.Save(CreateNew()); Assert.IsFalse(keyFeatureL.Update(kfNoDB)); } }
public void UpdateKeyFeature() { bool update; using (var db = new EntitesContext()) { ClearTable.KeyFeatures(db); keyFeatureL = Get(db); keyFeatureL.Save(CreateNew()); update = keyFeatureL.Update(new KeyFeature { Id = 1, IdFeature = 2, IdHaspKey = 3, StartDate = date.AddDays(5), EndDate = date.AddDays(10), }); } Assert.IsTrue(update); }