Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -52,6 +53,7 @@ public SupportPageViewModelTests() {
[Fact]
public void SupportPageViewModel_UploadLogsCommand_Execute_IsExecuted()
{
this.Mediator.Setup(m => m.Send(It.IsAny<SupportCommands.UploadLogsCommand>(), It.IsAny<CancellationToken>())).ReturnsAsync(Result.Success());
this.ViewModel.UploadLogsCommand.Execute(null);

this.Mediator.Verify(m => m.Send(It.IsAny<SupportCommands.UploadLogsCommand>(),It.IsAny<CancellationToken>()),Times.Once);
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -42,6 +44,7 @@ public AdminPageViewModelTests() {
[Fact]
public void AdminPageViewModel_AdminCommand_Execute_IsExecuted()
{
this.Mediator.Setup(m => m.Send(It.IsAny<TransactionCommands.PerformReconciliationCommand>(), It.IsAny<CancellationToken>())).ReturnsAsync(Result.Success());
this.ViewModel.ReconciliationCommand.Execute(null);
this.NavigationService.Verify(n => n.GoToHome(), Times.Once);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<PerformReconciliationResponseModel> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
Loading