public void TestTrueIsDirtyLogicOnCollection() { aggTestColl = new AggregateTestCollection(); AggregateTest aggTest = aggTestColl.AddNew(); aggTest.FirstName = "Mike"; aggTestColl.AcceptChanges(); Assert.IsFalse(aggTestColl.IsDirty); // Let's change it aggTest.FirstName = "Joe"; Assert.IsTrue(aggTestColl.IsDirty); // Now let's set it back to it's original value aggTest.FirstName = "Mike"; Assert.IsFalse(aggTestColl.IsDirty); // Let's change it again, notice we are no longer dirty now aggTest.FirstName = "Joe"; Assert.IsTrue(aggTestColl.IsDirty); }
public void TestDeleteOnCollection() { aggTestColl = new AggregateTestCollection(); AggregateTest aggTest = aggTestColl.AddNew(); aggTest.FirstName = "Mike"; aggTestColl.AcceptChanges(); Assert.IsFalse(aggTestColl.IsDirty); // Let's mark it as deleted aggTest.MarkAsDeleted(); Assert.IsTrue(aggTestColl.IsDirty); }
public void TestRejectChangesOnCollection2() { aggTestColl = new AggregateTestCollection(); AggregateTest aggTest = aggTestColl.AddNew(); aggTest.FirstName = "Mike"; aggTestColl.AcceptChanges(); Assert.IsFalse(aggTestColl.IsDirty); aggTest.FirstName = "Joe"; aggTest.RejectChanges(); Assert.IsFalse(aggTestColl.IsDirty); }