public void SettingWatchTaskAction_Results() { DummyReturnOneRetrieveAllSettingDao dao = new DummyReturnOneRetrieveAllSettingDao(); RetrieveAllSettingCacheProvider provider = new RetrieveAllSettingCacheProvider(new RetrieveAllManagerArguments() { RetrieveAllSettingDao = dao, CacheRefreshTimeout = () => TimeSpan.FromMilliseconds(0) }); provider.InitalizeSettingWatchTask(); SpinWait.SpinUntil(() => SettingCacheProviderBase.SettingDtosByKey.Count > 0); Assert.IsTrue(SettingCacheProviderBase.SettingDtosByKey.Count == 1); }
public void SettingWatchTaskAction_NoResults() { DummyRetrieveAllSettingDao dao = new DummyRetrieveAllSettingDao(); RetrieveAllSettingCacheProvider provider = new RetrieveAllSettingCacheProvider(new RetrieveAllManagerArguments() { RetrieveAllSettingDao = dao, CacheRefreshTimeout = () => TimeSpan.FromMilliseconds(0) }); provider.InitalizeSettingWatchTask(); SpinWait.SpinUntil(() => dao.GetChangedDbAppSettingsHitCount > 0); Assert.IsTrue(dao.GetChangedDbAppSettingsHitCount > 1); }