public async ThreadingTask DoesNotNavigateToSelectDefaultWorkspaceViewModelWhenNoDefaultWorkspaceStateIsNotSet() { AccessRestrictionStorage.HasNoDefaultWorkspace().Returns(false); ViewModel.ViewAppearing(); await NavigationService.DidNotReceive().Navigate <SelectDefaultWorkspaceViewModel, 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 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>(); }