示例#1
0
            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));
            }
示例#2
0
            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));
            }
示例#4
0
            public void RestricsAccessForClientDeprecatedException()
            {
                ErrorHandlingService.TryHandleDeprecationError(exception);

                AccessRestrictionStorage.Received().SetClientOutdated();
            }
示例#5
0
            public void RestricsAccessForClientDeprecatedException()
            {
                ErrorHandlingService.TryHandleUnauthorizedError(exception);

                AccessRestrictionStorage.Received().SetUnauthorizedAccess(Arg.Is(User.ApiToken));
            }
示例#6
0
            public void RestrictsAccessForNoWorkspaceException()
            {
                ErrorHandlingService.TryHandleNoDefaultWorkspaceError(new NoDefaultWorkspaceException());

                AccessRestrictionStorage.Received().SetNoDefaultWorkspaceStateReached(true);
            }