public void ClosesTheDialogWithoutSendingFeedbackWhenUserConfirmsDestructiveAction(NonEmptyString feedbackText) { DialogService.ConfirmDestructiveAction(Arg.Any <ActionType>()).Returns(Observable.Return(true)); ViewModel.FeedbackText.OnNext(feedbackText.Get); ViewModel.Close.Execute(); TestScheduler.Start(); NavigationService.Received().Close(ViewModel, false); }
public void DoesNotCloseTheDialogWhenUserCancelsDestructiveAction(NonEmptyString feedbackText) { DialogService.ConfirmDestructiveAction(Arg.Any <ActionType>()).Returns(Observable.Return(false)); ViewModel.FeedbackText.OnNext(feedbackText.Get); ViewModel.CloseButtonTapped.Execute().Wait(); TestScheduler.Start(); NavigationService.DidNotReceive().Close(Arg.Any <IMvxViewModelResult <bool> >(), Arg.Any <bool>()); }
protected void PrepareActionSheet(bool confirm) { DialogService.ConfirmDestructiveAction(ActionType.DeleteExistingTimeEntry) .Returns(Task.FromResult(confirm)); }