Ejemplo n.º 1
0
 public void RemoveErroneousIdKeyFeature()
 {
     using (var db = new EntitesContext())
     {
         keyFeatureL = Get(db);
         Assert.ThrowsException <ArgumentException>(() => keyFeatureL.Remove(erroneousId));
     }
 }
Ejemplo n.º 2
0
 public void RemoveNoDBKeyFeature()
 {
     using (var db = new EntitesContext())
     {
         ClearTable.KeyFeatures(db);
         keyFeatureL = Get(db);
         keyFeatureL.Save(CreateNew());
         Assert.IsFalse(keyFeatureL.Remove(123));
     }
 }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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));
        }