Ejemplo n.º 1
0
        public void GuidPropTest()
        {
            // Set class first, or it will throw an exception.
            const int hvo      = 1;
            var       clidAnal = SilDataAccess.MetaDataCache.GetClassId("ClassA");

            SilDataAccess.SetInt(hvo, (int)CmObjectFields.kflidCmObject_Class, clidAnal);

            // Now set its 'Guid' property.
            const int tag = (int)CmObjectFields.kflidCmObject_Guid;
            var       uid = Guid.NewGuid();

            SilDataAccess.SetGuid(hvo, tag, uid);
            var uid2 = SilDataAccess.get_GuidProp(hvo, tag);

            Assert.AreEqual(uid, uid2, "Wrong uid in cache.");

            // Test the reverse method.
            var hvo2 = SilDataAccess.get_ObjFromGuid(uid2);

            Assert.AreEqual(hvo, hvo2, "Wrong hvo in cache for Guid.");
        }