예제 #1
0
        protected void TestPutKeySet(IRemoteCache <string, string> cache)
        {
            cache.Remove(K1);
            cache.Remove(K2);
            ulong before = cache.Size();

            cache.Put(K1, V1);
            cache.Put(K2, V2);
            ISet <string> keyset = cache.KeySet();

            Assert.AreEqual(before + 2, keyset.Count);
        }
예제 #2
0
        public void KeySetTest()
        {
            String key1 = UniqueKey.NextKey();
            String key2 = UniqueKey.NextKey();
            String key3 = UniqueKey.NextKey();

            cache.Clear();
            cache.Put(key1, "v1");
            cache.Put(key2, "v2");
            cache.Put(key3, "v3");

            ISet <String> keys = cache.KeySet();

            Assert.AreEqual(3, keys.Count);
            Assert.IsTrue(keys.Contains(key1));
            Assert.IsTrue(keys.Contains(key2));
            Assert.IsTrue(keys.Contains(key3));
        }