예제 #1
0
        public virtual void TestWriteReadTypeOidAndVersion()
        {
            ObjectData data = CreateData(typeof(Role), 99, new FileVersion("user", 19));

            manager.InsertObject(data);

            ObjectData read = manager.LoadObjectData(data.Oid);

            Assert.AreEqual(data.Oid, read.Oid);
            Assert.AreEqual(data.ClassName, read.ClassName);
            Assert.AreEqual(data.Version, read.Version);
        }
예제 #2
0
        public virtual void TestSaveObject()
        {
            data[2].SetField("Person", SerialOid.CreatePersistent(231, typeof(Person).FullName));
            data[2].SetField("Name", "Fred");
            manager.Save(data[2]);

            Assert.IsTrue(Enumerable.Contains(manager.GetInstances(system.GetSpecification(typeof(object))), data[2]));
            ObjectData read = manager.LoadObjectData(oids[2]);

            Assert.AreEqual(data[2], read);
            Assert.AreEqual(data[2].Value("Name"), read.Value("Name"));
            Assert.AreEqual(data[2].GetField("Person"), read.GetField("Person"));
        }