public WebServiceEventArgs(WebServiceResult result) { Result = result; }
public async Task ShouldNotUpdateStatusIfSetFanModeFails() { var errorResult = new WebServiceResult(WebServiceError.Unknown, new Exception()); _nestWebService.Setup(n => n.SetFanModeAsync(It.IsAny<Thermostat>(), It.IsAny<FanMode>())).Returns(Task.FromResult(errorResult)); await _viewModel.LogInAsync(); _viewModel.FanMode = FanMode.Auto; _statusUpdaterService.Verify(s => s.UpdateStatusAsync(), Times.Never()); }
public async Task ShouldNotUpdateStatusIfChangeTemperatureFails() { var result = new WebServiceResult(WebServiceError.Unknown, new Exception()); _nestWebService.Setup(n => n.ChangeTemperatureAsync(It.IsAny<Thermostat>(), It.IsAny<double>(), It.IsAny<TemperatureMode>())) .Returns(Task.FromResult(result)); await _viewModel.LogInAsync(); _viewModel.TargetTemperature = NestViewModel.MaxTemperature; await _viewModel.LowerTemperatureAsync(); _statusUpdaterService.Verify(s => s.UpdateStatusAsync(), Times.Never()); }