public void Cities_LoadStates_TestEnums() { CityDomainContext dp = new CityDomainContext(TestURIs.Cities); SubmitOperation so = null; LoadOperation lo = dp.Load(dp.GetStatesQuery().Where(s => s.TimeZone == Cities.TimeZone.Pacific), false); EnqueueConditional(() => lo.IsComplete); EnqueueCallback(() => { if (lo.Error != null) Assert.Fail("LoadOperation.Error: " + lo.Error.Message); // verify the TimeZones were serialized to the client properly State state = dp.States.Single(p => p.Name == "WA"); Assert.AreEqual(Cities.TimeZone.Pacific, state.TimeZone); Assert.IsFalse(dp.States.Any(p => p.Name == "OH")); // Now test update state.TimeZone = state.TimeZone = Cities.TimeZone.Central; Assert.AreEqual(EntityState.Modified, state.EntityState); EntityChangeSet cs = dp.EntityContainer.GetChanges(); Assert.IsTrue(cs.ModifiedEntities.Contains(state)); so = dp.SubmitChanges(TestHelperMethods.DefaultOperationAction, null); }); EnqueueConditional(() => so.IsComplete); EnqueueCallback(() => { TestHelperMethods.AssertOperationSuccess(so); }); EnqueueTestComplete(); }