Example #1
0
        public void IntPropTest()
        {
            const int hvo  = 1;
            var       clid = SilDataAccess.MetaDataCache.GetClassId("ClassB");
            const int tag  = (int)CmObjectFields.kflidCmObject_Class;

            SilDataAccess.SetInt(hvo, tag, clid);
            var clid1 = SilDataAccess.get_IntProp(hvo, tag);

            Assert.AreEqual(clid, clid1, "Wrong clid in cache.");

            // See if the int is there via another method.
            // It should be there.
            bool isInCache;
            var  clid2 = VwCacheDa.get_CachedIntProp(hvo, tag, out isInCache);

            Assert.IsTrue(isInCache, "Int not in cache.");
            Assert.AreEqual(clid1, clid2, "Clids are not the same.");

            // See if the int is there via another method.
            // It should not be there.
            var ownerHvo = VwCacheDa.get_CachedIntProp(hvo, (int)CmObjectFields.kflidCmObject_Owner, out isInCache);

            Assert.IsFalse(isInCache, "Int is in cache.");
            Assert.AreEqual(0, ownerHvo, "Wrong owner.");
        }
Example #2
0
        public void IntPropTest()
        {
            CheckDisposed();

            int  hvo  = 1;
            uint clid = SilDataAccess.MetaDataCache.GetClassId("PartOfSpeech");
            int  tag  = (int)CmObjectFields.kflidCmObject_Class;

            SilDataAccess.SetInt(hvo, tag, (int)clid);
            int clid1 = SilDataAccess.get_IntProp(hvo, tag);

            Assert.AreEqual((int)clid, clid1, "Wrong clid in cache.");

            // See if the int is there via another method.
            // It should be there.
            bool isInCache = false;
            int  clid2     = VwCacheDa.get_CachedIntProp(hvo, tag, out isInCache);

            Assert.IsTrue(isInCache, "Int not in cache.");
            Assert.AreEqual(clid1, clid2, "Clids are not the same.");

            // See if the int is there via another method.
            // It should not be there.
            isInCache = true;
            int ownerHvo = VwCacheDa.get_CachedIntProp(hvo, (int)CmObjectFields.kflidCmObject_Owner, out isInCache);

            Assert.IsFalse(isInCache, "Int is in cache.");
            Assert.AreEqual(0, ownerHvo, "Wrong owner.");
        }