public void ShouldBeDirtyWhenRecordsAdded() { var cat = new Category { CategoryName = "Foo" }; var repo = new TestRepo(Context); repo.Add(cat, false); Assert.True(repo.HasChanges); }
public void ShouldBeDirtyWhenRecordsUpdated() { ExecuteInATransaction(RunTheTest); void RunTheTest() { CreateCategoryAndProducts(); var repo = new TestRepo(Context); var cat = Context.Categories.First(); cat.CategoryName = "Bar"; Assert.True(repo.HasChanges); } }
public void ShouldBeDirtyWhenRecordsDeleted() { ExecuteInATransaction(RunTheTest); void RunTheTest() { CreateCategoryAndProducts(); var repo = new TestRepo(Context); var cat = repo.Find(1); repo.Delete(cat, false); Assert.True(repo.HasChanges); } }