public void TestHasKeyWithPopulateAtStartupWithoutAwaitingIndex() { ICacheKey key = PutOneThingInCache(); // A new cache object in the same directory. Equivalent to a process restart. // Index may not yet updated. DiskStorageCache cache2 = CreateDiskCache(_storage, true); Assert.IsTrue(cache2.HasKey(key)); Assert.IsTrue(cache2.HasKeySync(key)); }
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)); }