public async ThreadingTask DoesNotNavigateToNoWorkspaceViewModelWhenNoWorkspaceStateIsNotSet()
            {
                AccessRestrictionStorage.HasNoWorkspace().Returns(false);

                ViewModel.ViewAppearing();

                await NavigationService.DidNotReceive().Navigate <NoWorkspaceViewModel, Unit>();
            }
            public async ThreadingTask NavigatesToNoWorkspaceViewModelWhenNoWorkspaceStateIsSet()
            {
                AccessRestrictionStorage.HasNoWorkspace().Returns(true);

                ViewModel.ViewAppearing();

                await NavigationService.Received().Navigate <NoWorkspaceViewModel, Unit>();
            }
            public async ThreadingTask NavigatesToSelectDefaultWorkspaceViewModelWhenNoDefaultWorkspaceStateIsSet()
            {
                AccessRestrictionStorage.HasNoWorkspace().Returns(false);
                AccessRestrictionStorage.HasNoDefaultWorkspace().Returns(true);

                await ViewModel.ViewAppearingAsync();

                await NavigationService.Received().Navigate <SelectDefaultWorkspaceViewModel, Unit>();
            }
            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);
            }
            public async ThreadingTask DoesNotNavigateToNoWorkspaceViewSeveralTimes()
            {
                AccessRestrictionStorage.HasNoWorkspace().Returns(true);
                var task = new TaskCompletionSource <Unit>().Task;

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

                ViewModel.ViewAppearing();
                ViewModel.ViewAppearing();
                ViewModel.ViewAppearing();
                ViewModel.ViewAppearing();

                await NavigationService.Received(1).Navigate <NoWorkspaceViewModel, Unit>();
            }
            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>();
            }