Example #1
0
        public async Task drops_items_in_gen1_when_gen0_is_full()
        {
            var cache = new ReadThroughCache <int, int>(new ValueIsKey <int, int>(), 3, null);

            for (int i = 1; i <= 7; i++)
            {
                Assert.AreEqual(i, await cache.GetAsync(i));
            }
            Assert.AreEqual(3, cache._gen1.Count, "gen1.Count");
            Assert.AreEqual(1, cache._gen0.Count, "gen0.Count");
        }
Example #2
0
        public async Task can_read_item_from_underlying_cache(int key)
        {
            var cache = new ReadThroughCache <int, int>(new ValueIsKey <int, int>(), 3, null);

            Assert.AreEqual(key, await cache.GetAsync(key));
        }