public void ExecuteAsync_Handles_Client_Failure() { _mockConfigurationStorageClient.Setup(c => c.ExecuteAsync(It.IsAny <string>(), _token)).ThrowsAsync(new Exception()); Should.NotThrow(async() => await _configurationUpdaterJob.ExecuteAsync(It.IsAny <string>(), _token)); _mockSettingsCacheManager.Verify( manager => manager.ReloadSettingsCache(It.IsAny <SettingsCache <int> >(), It.IsAny <SettingsCache <bool> >(), It.IsAny <SettingsCache <string> >()), Times.Never()); }
private void ExecuteJob(object state) { Task.Run(() => _job.ExecuteAsync(_applicationName, _cancellationTokenSource.Token)).GetAwaiter().GetResult(); }