public void TryGetCachedValue_ReturnsFalseINotfFound() { ConfigCacheTestHelper sut = new ConfigCacheTestHelper(); sut.CacheInsert("SomeKey", "SomeValue"); sut.CacheInsert("SomeKey", "SomeNewValue"); sut.CacheInsert("SomeKey2", "SomeNewValue2"); sut.CacheInsert("SomeKey3", "SomeNewValue3"); string value; Assert.IsFalse(sut.TryGetCachedValue("SomeUnkownKey", out value)); }
public void TryGetCachedValue_SetsValueToNullIfNotFound() { ConfigCacheTestHelper sut = new ConfigCacheTestHelper(); sut.CacheInsert("SomeKey", "SomeValue"); sut.CacheInsert("SomeKey", "SomeNewValue"); sut.CacheInsert("SomeKey2", "SomeNewValue2"); sut.CacheInsert("SomeKey3", "SomeNewValue3"); string value; sut.TryGetCachedValue("SomeUnkownKey", out value); Assert.IsNull(value); }
public void TryGetCachedValue_SetsValueIfFound() { ConfigCacheTestHelper sut = new ConfigCacheTestHelper(); sut.CacheInsert("SomeKey", "SomeValue"); sut.CacheInsert("SomeKey", "SomeNewValue"); sut.CacheInsert("SomeKey2", "SomeNewValue2"); sut.CacheInsert("SomeKey3", "SomeNewValue3"); string value; sut.TryGetCachedValue("SomeKey", out value); Assert.IsTrue(value == "SomeNewValue"); }