diff --git a/TransactionProcessor.Mobile.BusinessLogic.Tests/ViewModelTests/Support/SupportPageViewModelTests.cs b/TransactionProcessor.Mobile.BusinessLogic.Tests/ViewModelTests/Support/SupportPageViewModelTests.cs index 6bae3e60c..fa8ba7e6f 100644 --- a/TransactionProcessor.Mobile.BusinessLogic.Tests/ViewModelTests/Support/SupportPageViewModelTests.cs +++ b/TransactionProcessor.Mobile.BusinessLogic.Tests/ViewModelTests/Support/SupportPageViewModelTests.cs @@ -2,6 +2,7 @@ using MediatR; using Moq; using Shouldly; +using SimpleResults; using TransactionProcessor.Mobile.BusinessLogic.Database; using TransactionProcessor.Mobile.BusinessLogic.Requests; using TransactionProcessor.Mobile.BusinessLogic.Services; @@ -52,6 +53,7 @@ public SupportPageViewModelTests() { [Fact] public void SupportPageViewModel_UploadLogsCommand_Execute_IsExecuted() { + this.Mediator.Setup(m => m.Send(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success()); this.ViewModel.UploadLogsCommand.Execute(null); this.Mediator.Verify(m => m.Send(It.IsAny(),It.IsAny()),Times.Once); diff --git a/TransactionProcessor.Mobile.BusinessLogic.Tests/ViewModelTests/Transactions/Admin/AdminPageViewModelTests.cs b/TransactionProcessor.Mobile.BusinessLogic.Tests/ViewModelTests/Transactions/Admin/AdminPageViewModelTests.cs index 01219b78b..096605f23 100644 --- a/TransactionProcessor.Mobile.BusinessLogic.Tests/ViewModelTests/Transactions/Admin/AdminPageViewModelTests.cs +++ b/TransactionProcessor.Mobile.BusinessLogic.Tests/ViewModelTests/Transactions/Admin/AdminPageViewModelTests.cs @@ -1,5 +1,7 @@ using MediatR; using Moq; +using SimpleResults; +using TransactionProcessor.Mobile.BusinessLogic.Requests; using TransactionProcessor.Mobile.BusinessLogic.Services; using TransactionProcessor.Mobile.BusinessLogic.UIServices; using TransactionProcessor.Mobile.BusinessLogic.ViewModels.Admin; @@ -42,6 +44,7 @@ public AdminPageViewModelTests() { [Fact] public void AdminPageViewModel_AdminCommand_Execute_IsExecuted() { + this.Mediator.Setup(m => m.Send(It.IsAny(), It.IsAny())).ReturnsAsync(Result.Success()); this.ViewModel.ReconciliationCommand.Execute(null); this.NavigationService.Verify(n => n.GoToHome(), Times.Once); } diff --git a/TransactionProcessor.Mobile.BusinessLogic/ViewModels/Admin/AdminPageViewModel.cs b/TransactionProcessor.Mobile.BusinessLogic/ViewModels/Admin/AdminPageViewModel.cs index e6dc6ae1e..460ad85ff 100644 --- a/TransactionProcessor.Mobile.BusinessLogic/ViewModels/Admin/AdminPageViewModel.cs +++ b/TransactionProcessor.Mobile.BusinessLogic/ViewModels/Admin/AdminPageViewModel.cs @@ -41,10 +41,15 @@ private async Task Reconciliation() CorrelationIdProvider.NewId(); TransactionCommands.PerformReconciliationCommand command = new TransactionCommands.PerformReconciliationCommand(DateTime.Now, String.Empty, this.ApplicationInfoService.VersionString); - await this.Mediator.Send(command); - - // TODO: Act on the response (display message or something)... - await this.NavigationService.GoToHome(); + Result result = await this.Mediator.Send(command); + + if (result.IsSuccess) { + await this.DialogService.ShowInformationToast("Reconciliation Succeeded"); + await this.NavigationService.GoToHome(); + } + else { + await this.DialogService.ShowWarningToast("Reconciliation Failed"); + } } #endregion diff --git a/TransactionProcessor.Mobile.BusinessLogic/ViewModels/Support/SupportPageViewModel.cs b/TransactionProcessor.Mobile.BusinessLogic/ViewModels/Support/SupportPageViewModel.cs index 95e95bc11..aee7a714b 100644 --- a/TransactionProcessor.Mobile.BusinessLogic/ViewModels/Support/SupportPageViewModel.cs +++ b/TransactionProcessor.Mobile.BusinessLogic/ViewModels/Support/SupportPageViewModel.cs @@ -71,17 +71,20 @@ private async Task UploadLogs() { SupportCommands.UploadLogsCommand command = new(String.Empty); - await this.Mediator.Send(command, CancellationToken.None); + var result = await this.Mediator.Send(command, CancellationToken.None); - // TODO: Act on the response (display message or something)... - //await this.NavigationService.GoBack(); + if (result.IsSuccess) { + await this.DialogService.ShowInformationToast("Logs have been uploaded successfully."); + await this.NavigationService.GoBack(); + } else { + await this.DialogService.ShowWarningToast("Failed to upload logs."); + } } [RelayCommand] private async Task ViewLogs() { Logger.LogInformation("ViewLogs called"); - // TODO: Act on the response (display message or something)... await this.NavigationService.GoToViewLogsPage(); }