Beispiel #1
0
            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);
            }
Beispiel #2
0
            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));
 }