コード例 #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));
            }
コード例 #3
0
            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);
            }