示例#1
0
        public void TestCache()
        {
            var storage1 = new MyCache <int, string>();

            var containsBefore1 = storage1.Contains(1);

            storage1.Upsert(1, "value1");
            var containsAfter1 = storage1.Contains(1);
            var value1         = storage1.Get(1);

            var storage2 = new MyCache <int, string>();

            var containsBefore2 = storage2.Contains(1);

            storage2.Upsert(1, "value2");
            var containsAfter2 = storage2.Contains(1);
            var value2         = storage2.Get(1);
        }