public void CanRead() { using (NewDatabaseEntities db = new NewDatabaseEntities()) { var items = db.Items.ToList(); Assert.IsTrue(items.Count() > 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); } }
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); } }