コード例 #1
0
 public WebServiceEventArgs(WebServiceResult result)
 {
     Result = result;
 }
コード例 #2
0
			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());
			}
コード例 #3
0
 public WebServiceEventArgs(WebServiceResult result)
 {
     Result = result;
 }
コード例 #4
0
			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());
			}