Beispiel #1
0
        public void TestHasKeyWithPopulateAtStartupWithAwaitingIndex()
        {
            ICacheKey key = PutOneThingInCache();

            // A new cache object in the same directory. Equivalent to a process restart.
            // Index should be updated.
            DiskStorageCache cache2 = CreateDiskCache(_storage, true);

            // Wait for index populated in cache before use of cache
            cache2.AwaitIndex();
            Assert.IsTrue(cache2.HasKeySync(key));
            Assert.IsTrue(cache2.HasKey(key));
        }