Пример #1
0
        public void TestDiskCacheProviderLoad()
        {
            DiskCacheProvider provider = new DiskCacheProvider(Path.GetTempPath() + nameof(TestDiskCacheProviderLoad));

            provider.Store("test", "hellofriend");
            provider.Store("tost", "hallofreund");

            Assert.AreEqual("hellofriend", provider.Load <string>("test"));
            Assert.AreEqual("hallofreund", provider.Load <string>("tost"));
        }
Пример #2
0
        public void TestDiskCacheProviderStore()
        {
            DiskCacheProvider provider = new DiskCacheProvider(Path.GetTempPath() + nameof(TestDiskCacheProviderStore));

            provider.Store("test", "hellofriend");
            provider.Store("tost", "hallofreund");

            Assert.IsTrue(provider.IsCached("test"));
            Assert.IsTrue(provider.IsCached("tost"));
        }