public async Task ForceRefreshAsync_ConfigServiceThrowException_ShouldNotReThrowTheExceptionAndLogsError() { // Arrange configServiceMock.Setup(m => m.RefreshConfigAsync()).Throws <Exception>(); IConfigCatClient instance = new ConfigCatClient( configServiceMock.Object, loggerMock.Object, evaluatorMock.Object, configDeserializerMock.Object); // Act await instance.ForceRefreshAsync(); // Assert loggerMock.Verify(m => m.Error(It.IsAny <string>()), Times.Once); }
public async Task ForceRefreshAsync_ShouldInvokeConfigServiceRefreshConfigAsync() { // Arrange configServiceMock.Setup(m => m.RefreshConfigAsync()).Returns(Task.CompletedTask); IConfigCatClient instance = new ConfigCatClient( configServiceMock.Object, loggerMock.Object, evaluatorMock.Object, configDeserializerMock.Object); // Act await instance.ForceRefreshAsync(); // Assert configServiceMock.Verify(m => m.RefreshConfigAsync(), Times.Once); }
public async Task ForceRefreshAsync() { await _configClient.ForceRefreshAsync(); }