public void IfCacheSpecified_UpsertingConfigValueClearsCache() { IConfigCache configCache = MockRepository.GenerateStub <IConfigCache>(); CacheableConfigController sut = new CacheableConfigController(); sut.Cache = configCache; Queue <string> priority = new Queue <string>(); priority.Enqueue("FirstPlane"); configCache.AssertWasNotCalled(x => x.ClearCache()); sut.UpsertDefaultConfigValue("FirstPlane", "ConfigKey", "ConfigValue"); configCache.AssertWasCalled(x => x.ClearCache()); }
public void IfCacheSpecified_ChangingContextClearsCache() { IConfigCache configCache = MockRepository.GenerateStub <IConfigCache>(); CacheableConfigController sut = new CacheableConfigController(); sut.Cache = configCache; Queue <string> priority = new Queue <string>(); priority.Enqueue("FirstPlane"); configCache.AssertWasNotCalled(x => x.ClearCache()); sut.SetContext(new Dictionary <string, string>()); configCache.AssertWasCalled(x => x.ClearCache()); }