Exemple #1
0
        public void CanRead()
        {
            using (NewDatabaseEntities db = new NewDatabaseEntities())
            {
                var items = db.Items.ToList();

                Assert.IsTrue(items.Count() > 0);
            }
        }
Exemple #2
0
        public void ItemIsModified_WhenDifferentColorIsAssigned()
        {
            using (NewDatabaseEntities db = new NewDatabaseEntities())
            {
                var  items = db.Items.ToList();
                Item item0 = items.First();
                item0.Color = "Not a color";

                DbEntityEntry <Item> item = db.ChangeTracker.Entries <Item>().FirstOrDefault();

                Assert.AreEqual(item.State, EntityState.Modified);
            }
        }
Exemple #3
0
        public void ItemIsUnchanged_WhenSaveValueUssigned()
        {
            using (NewDatabaseEntities db = new NewDatabaseEntities())
            {
                var    items = db.Items.ToList();
                Item   item0 = items.First();
                String color = (String)item0.Color.Clone();
                item0.Color = color;

                DbEntityEntry <Item> item = db.ChangeTracker.Entries <Item>().FirstOrDefault();

                Assert.AreEqual(item.State, EntityState.Unchanged);
            }
        }