private async void CalculatePriceCommandExecuteAsync() { CalculatePriceRequest request = new CalculatePriceRequest(Request); IsBusy = true; PriceResponse response = await _backendApiService.SubmitCalculatePriceRequest(request); IsBusy = false; if (response == null) { await DialogService.DisplayAlertAsync("Forbindelse", "Pris kunne ikke beregnes - ingen internetforbindelse", "OK"); } else if (response.WasUnsuccessfull()) { await DialogService.DisplayAlertAsync("Ukendt fejl", "Prisen for turen kunne ikke beregnes", "OK"); } else if (response.WasSuccessfull()) { Price = response.Body.Price; } }
public void CalculatePriceCommand_ApiReturnsNull_DialogServiceShowsMessage() { _fakeBackendApiService.SubmitCalculatePriceRequest(new CalculatePriceRequest(_uut.Request)).ReturnsNull(); _uut.CalculatePriceCommand.Execute(); _fakePageDialogService.Received().DisplayAlertAsync("Forbindelse", Arg.Any <string>(), Arg.Any <string>()); }