Exemplo n.º 1
0
            public async ThreadingTask DoesNotNavigateToSelectDefaultWorkspaceViewModelWhenNoDefaultWorkspaceStateIsNotSet()
            {
                AccessRestrictionStorage.HasNoDefaultWorkspace().Returns(false);

                ViewModel.ViewAppearing();

                await NavigationService.DidNotReceive().Navigate <SelectDefaultWorkspaceViewModel, Unit>();
            }
Exemplo n.º 2
0
            public async ThreadingTask NavigatesToSelectDefaultWorkspaceViewModelWhenNoDefaultWorkspaceStateIsSet()
            {
                AccessRestrictionStorage.HasNoWorkspace().Returns(false);
                AccessRestrictionStorage.HasNoDefaultWorkspace().Returns(true);

                await ViewModel.ViewAppearingAsync();

                await NavigationService.Received().Navigate <SelectDefaultWorkspaceViewModel, Unit>();
            }
Exemplo n.º 3
0
            public async ThreadingTask DoesNotNavigateToSelectDefaultWorkspaceViewModelWhenTheresNoWorkspaceAvaialable()
            {
                AccessRestrictionStorage.HasNoWorkspace().Returns(true);
                AccessRestrictionStorage.HasNoDefaultWorkspace().Returns(true);

                await ViewModel.ViewAppearingAsync();

                await NavigationService.Received().Navigate <NoWorkspaceViewModel, Unit>(View);

                await NavigationService.DidNotReceive().Navigate <SelectDefaultWorkspaceViewModel, Unit>(View);
            }
Exemplo n.º 4
0
            public async ThreadingTask DoesNotNavigateToSelectDefaultWorkspaceViewSeveralTimes()
            {
                AccessRestrictionStorage.HasNoWorkspace().Returns(false);
                AccessRestrictionStorage.HasNoDefaultWorkspace().Returns(true);
                var task = new TaskCompletionSource <Unit>().Task;

                NavigationService.Navigate <SelectDefaultWorkspaceViewModel, Unit>().Returns(task);

                ViewModel.ViewAppearing();
                ViewModel.ViewAppearing();
                ViewModel.ViewAppearing();
                ViewModel.ViewAppearing();
                //ViewAppearing calls an async method. The delay is here to ensure that the async method completes before the assertion
                await ThreadingTask.Delay(200);

                await NavigationService.Received(1).Navigate <SelectDefaultWorkspaceViewModel, Unit>();
            }