public void Test_UnCache() { var fakecachedictionary = new FakeCacheDictionary1(); var i = 1; Assert.Equal(i.ToString(), fakecachedictionary.Get(i)); Assert.True(fakecachedictionary.IsCached(1)); Assert.True(fakecachedictionary.UnCache(1)); Assert.False(fakecachedictionary.IsCached(1)); Assert.Equal(i.ToString(), fakecachedictionary.Get(i)); Assert.True(fakecachedictionary.IsCached(1)); }
public void Test_GetValues() { var fakecachedictionary = new FakeCacheDictionary1(); var i = 1; Assert.Equal(i.ToString(), fakecachedictionary.Get(i)); i = 2; Assert.Equal(i.ToString(), fakecachedictionary.Get(i)); var values = fakecachedictionary.GetValues(); Assert.Equal(new[] { "1", "2" }, values); }
public void Test_GetKeyValues() { var fakecachedictionary = new FakeCacheDictionary1(); var i = 1; Assert.Equal(i.ToString(), fakecachedictionary.Get(i)); i = 2; Assert.Equal(i.ToString(), fakecachedictionary.Get(i)); var values = fakecachedictionary.GetKeyValues(); Assert.Equal(new KeyValuePair <int, string>[] { new KeyValuePair <int, string>(1, "1"), new KeyValuePair <int, string>(2, "2"), }, values); }
public void Test_Factory() { var fakecachedictionary = new FakeCacheDictionary1(); var i = 1; Assert.Equal(i.ToString(), fakecachedictionary.Get(i)); }