public void TestPersistent() { var pm = PmFactory.NewPersistenceManager(); InnerDate id = new InnerDate(); pm.MakePersistent(id); pm.Save(); pm.UnloadCache(); id.SetInnerDate(); ObjectHelper.MarkDirty(id); Assert.AreEqual(NDOObjectState.PersistentDirty, id.NDOObjectState, "Status falsch"); pm.Save(); }
public void TestCreated() { var pm = PmFactory.NewPersistenceManager(); // dt = new DateTime(2004, 10, 12, 13, 30, 31, 123); DateTestClass dtc = new DateTestClass(); InnerDate id = new InnerDate(); id.SetInnerDate(); pm.MakePersistent(id); pm.MakePersistent(dtc); pm.Save(); dtc.InnerDate = id; dtc.Name = "Test"; pm.Save(); pm.UnloadCache(); NDOQuery <DateTestClass> q = new NDOQuery <DateTestClass>(pm, null); dtc = (DateTestClass)q.ExecuteSingle(true); Assert.AreEqual(2002, dtc.InnerDate.Dt.Year, "DateTime konnte nicht richtig gelesen werden"); }