public async Task ResetsNoWorkspaceStateWhenAnotherWorkspaceIsFetched() { var workspace = Substitute.For <IThreadSafeWorkspace>(); DataSource.Workspaces.GetAll().Returns(Observable.Return(new List <IThreadSafeWorkspace>() { workspace })); await ViewModel.TryAgain(); AccessRestrictionStorage.Received().SetNoWorkspaceStateReached(Arg.Is(false)); }
public async Task ResetsNoWorkspaceStateWhenAfterNewWorkspaceIsCreated() { var workspace = Substitute.For <IThreadSafeWorkspace>(); InteractorFactory.CreateDefaultWorkspace().Execute().Returns(Observable.Return(Unit.Default)); DataSource.Workspaces.GetAll().Returns(Observable.Return(new List <IThreadSafeWorkspace> { workspace })); await ViewModel.CreateWorkspaceWithDefaultName(); AccessRestrictionStorage.Received().SetNoWorkspaceStateReached(Arg.Is(false)); }
public async Task ResetsNoWorkspaceStateWhenAnotherWorkspaceIsFetched() { var workspace = Substitute.For <IThreadSafeWorkspace>(); InteractorFactory.GetAllWorkspaces().Execute().Returns(Observable.Return(new List <IThreadSafeWorkspace>() { workspace })); ViewModel.TryAgain.Execute(); TestScheduler.Start(); AccessRestrictionStorage.Received().SetNoWorkspaceStateReached(Arg.Is(false)); }
public void RestricsAccessForClientDeprecatedException() { ErrorHandlingService.TryHandleDeprecationError(exception); AccessRestrictionStorage.Received().SetClientOutdated(); }
public void RestricsAccessForClientDeprecatedException() { ErrorHandlingService.TryHandleUnauthorizedError(exception); AccessRestrictionStorage.Received().SetUnauthorizedAccess(Arg.Is(User.ApiToken)); }
public void RestrictsAccessForNoWorkspaceException() { ErrorHandlingService.TryHandleNoDefaultWorkspaceError(new NoDefaultWorkspaceException()); AccessRestrictionStorage.Received().SetNoDefaultWorkspaceStateReached(true); }