コード例 #1
0
 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());
 }
コード例 #2
0
 private void ExecuteJob(object state)
 {
     Task.Run(() =>
              _job.ExecuteAsync(_applicationName, _cancellationTokenSource.Token)).GetAwaiter().GetResult();
 }