public void MemoryCacheManager_Should_Return_Count_When_Asked_So() { ICacheManager cacheManager = new MemoryCacheManager(); cacheManager.Add("Test", "Dit is de waarde...", new CacheItemPolicy()); cacheManager.Add("Test2", "Dit is de tweede waarde...", new CacheItemPolicy()); cacheManager.Add("Test3", "Dit is de derde waarde...", new CacheItemPolicy()); Assert.AreEqual(3, cacheManager.Count()); }
public void MemoryCacheManager_Should_Contain_No_Values_When_Cleared() { ICacheManager cacheManager = new MemoryCacheManager(); cacheManager.Add("Test", "Dit is de waarde...", new CacheItemPolicy()); cacheManager.Add("Test2", "Dit is de tweede waarde...", new CacheItemPolicy()); cacheManager.Add("Test3", "Dit is de derde waarde...", new CacheItemPolicy()); cacheManager.Clear(); Assert.AreEqual(0, cacheManager.Count()); }
public void MemoryCacheManager_Should_Contain_Only_Values_That_Where_Not_To_Be_Deleted() { ICacheManager cacheManager = new MemoryCacheManager(); cacheManager.Add("Test", "Dit is de waarde...", new CacheItemPolicy()); cacheManager.Add("Test2", "Dit is de tweede waarde...", new CacheItemPolicy()); cacheManager.Add("Test3", "Dit is de derde waarde...", new CacheItemPolicy()); IList <string> collection = new List <string> { "Test", "Test3" }; cacheManager.Remove(collection); Assert.AreEqual(1, cacheManager.Count()); }