示例#1
0
 public void UpdateNullKeyFeature()
 {
     using (var db = new EntitesContext())
     {
         keyFeatureL = Get(db);
         Assert.ThrowsException <ArgumentNullException>(() => keyFeatureL.Update(null));
     }
 }
示例#2
0
        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);
        }
示例#3
0
        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));
            }
        }
示例#4
0
        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);
        }