public void SettingWatchTaskAction_Results() { DummyReturnOneLazyLoadSettingDao dao = new DummyReturnOneLazyLoadSettingDao(); LazyLoadSettingCacheProvider provider = new LazyLoadSettingCacheProvider(new LazyLoadManagerArguments() { LazyLoadSettingDao = dao, CacheRefreshTimeout = () => TimeSpan.FromMilliseconds(0) }); provider.InitalizeSettingWatchTask(); SpinWait.SpinUntil(() => SettingCacheProviderBase.SettingDtosByKey.Count > 0); Assert.IsTrue(SettingCacheProviderBase.SettingDtosByKey.Count == 1); }
public void SettingWatchTaskAction_NoResults() { DummyLazyLoadSettingDao dao = new DummyLazyLoadSettingDao(); LazyLoadSettingCacheProvider provider = new LazyLoadSettingCacheProvider(new LazyLoadManagerArguments() { LazyLoadSettingDao = dao, CacheRefreshTimeout = () => TimeSpan.FromMilliseconds(0) }); provider.InitalizeSettingWatchTask(); SpinWait.SpinUntil(() => dao.GetChangedDbAppSettingsHitCount > 0); Assert.IsTrue(dao.GetChangedDbAppSettingsHitCount > 1); }