public void ValidationTest()
        {
            var viewModel = new ConfirmationCodeEntryViewModel(1, null, accountService.Object, viewService.Object, dataFlow.Object, deviceInfo.Object, connectivity.Object);

            Assert.False(viewModel.CanConfirm(), "Confirm command should be disabled initially");
            viewModel.ConfirmationCode.Value = "87304";
            Assert.True(viewModel.CanConfirm(), "Confirm command should become enabled when confirmation code is entered");
            viewModel.ConfirmationCode.Value = "";
            Assert.False(viewModel.CanConfirm(), "Confirm command should become disabled when confirmation code is not entered");
        }
        public async Task ShouldNavigateToSetPINPageWhenEnteredValidConfirmationCode()
        {
            viewService
            .Setup(m => m.SetCurrentPage(It.Is((BaseViewModel p) => p.GetType() == typeof(SetPinViewModel))))
            .Verifiable();
            SetPinViewModel CreateSetPinView() => new SetPinViewModel(null, null, null, null, null);

            var viewModel = new ConfirmationCodeEntryViewModel(1, CreateSetPinView, accountService.Object, viewService.Object, dataFlow.Object, deviceInfo.Object, connectivity.Object);

            viewModel.View = view.Object;
            viewModel.ConfirmationCode.Value = ValidCode;
            await viewModel.Confirm();

            viewService.Verify();
        }
        public async Task ShouldShowErrorMessageWhenEnteredInvalidConfirmationCode()
        {
            view
            .Setup(m => m.DisplayAlert("Invalid Code", "Invalid confirmation code", "Ok"))
            .Returns(Task.CompletedTask)
            .Verifiable("Expected to show an error message when confirmation code is invalid");

            var viewModel = new ConfirmationCodeEntryViewModel(1, null, accountService.Object, viewService.Object, dataFlow.Object, deviceInfo.Object, connectivity.Object);

            viewModel.View = view.Object;
            viewModel.ConfirmationCode.Value = "an invalid confirmation code";
            await viewModel.Confirm();

            view.Verify();
            dataFlow.VerifyNoOtherCalls();
            viewService.VerifyNoOtherCalls();
        }