public ILRUCache <SimpleLRUCacheItem, int> MakeRainbowCache_lock(int Capacity) { var c = new LRUCache_lock <SimpleLRUCacheItem, int, string>(Capacity); SimpleLRUCacheTests.AddRainbowItems(c); return(c); }
public void CreateLRUCache_lock() { var c = new LRUCache_lock <SimpleLRUCacheItem, int, string>(); Console.WriteLine("Created Empty Cache."); Assert.AreEqual(0, c.Count, 0, "Cache size is not zero"); c.Put(new SimpleLRUCacheItem(1, "Red")); Assert.AreEqual(1, c.Count, 0, "Cache size is not one"); c.Put(new SimpleLRUCacheItem(2, "Blue")); Assert.AreEqual(2, c.Count, 0, "Cache size is not two"); SimpleLRUCacheTests_lockfree.DumpCache(c, "Most Used/ Recently added to Least used/Oldest "); Console.WriteLine("lock Test Complete."); }
public void ManyGets10k() { var c = new LRUCache_lock <SimpleLRUCacheItem, int, string>(1000); ManyGets(c, 10000); }
public void RemoveTest() { var c = new LRUCache_lock <SimpleLRUCacheItem, int, string>(10); RemoveOneTest(c); }
public void ExpirationTest1() { var c = new LRUCache_lock <SimpleLRUCacheItem, int, string>(10); ExpirationTest(c); }
public void ParallelOperation1() { var c = new LRUCache_lock <SimpleLRUCacheItem, int, string>(1000); ParallelOperations(c); }