public void RoundtripOriginalOnClass_VerifyPartialObjects() { TestDomainServices.TestProvider_Scenarios ctxt = new TestDomainServices.TestProvider_Scenarios(TestURIs.TestProvider_Scenarios); TestDomainServices.RoundtripOriginal_TestEntity2 entity = new TestDomainServices.RoundtripOriginal_TestEntity2 { ID = 1, RoundtrippedMember1 = 1, RoundtrippedMember2 = 1 }; ctxt.EntityContainer.LoadEntities(new Entity[] { entity }); entity.RoundtrippedMember1 += 1; entity.RoundtrippedMember2 += 2; EntityChangeSet cs = ctxt.EntityContainer.GetChanges(); TestDomainServices.RoundtripOriginal_TestEntity2 original = (TestDomainServices.RoundtripOriginal_TestEntity2)cs.GetChangeSetEntries().First().OriginalEntity; // verify members with roundtrip have the original value Assert.AreEqual(2, entity.RoundtrippedMember1); Assert.AreEqual(3, entity.RoundtrippedMember2); Assert.AreEqual(1, original.RoundtrippedMember1); Assert.AreEqual(1, original.RoundtrippedMember2); }
public void RoundtripOriginalOnClass_VerifyPartialObjects() { TestDomainServices.TestProvider_Scenarios ctxt = new TestDomainServices.TestProvider_Scenarios(TestURIs.TestProvider_Scenarios); TestDomainServices.RoundtripOriginal_TestEntity2 entity = new TestDomainServices.RoundtripOriginal_TestEntity2 { ID = 1, RoundtrippedMember1 = 1, RoundtrippedMember2 = 1 }; ctxt.EntityContainer.LoadEntities(new Entity[] { entity }); entity.RoundtrippedMember1 += 1; entity.RoundtrippedMember2 += 2; EntityChangeSet cs = ctxt.EntityContainer.GetChanges(); TestDomainServices.RoundtripOriginal_TestEntity2 original = (TestDomainServices.RoundtripOriginal_TestEntity2)cs.GetChangeSetEntries().First().OriginalEntity; // verify members with roundtrip have the original value Assert.AreEqual(2, entity.RoundtrippedMember1); Assert.AreEqual(3, entity.RoundtrippedMember2); Assert.AreEqual(1, original.RoundtrippedMember1); Assert.AreEqual(1, original.RoundtrippedMember2); }