Ejemplo n.º 1
0
            public void DoesNotRestrictAccessForDifferentExceptions()
            {
                ErrorHandlingService.TryHandleDeprecationError(exception);

                AccessRestrictionStorage.DidNotReceive().SetApiOutdated();
                AccessRestrictionStorage.DidNotReceive().SetClientOutdated();
            }
            public async Task DoesNothingWhenNoWorkspacesAreFetched()
            {
                DataSource.Workspaces.GetAll().Returns(Observable.Return(new List <IThreadSafeWorkspace>()));

                ViewModel.TryAgain.Execute();
                TestScheduler.Start();

                View.DidNotReceive().Close();
                AccessRestrictionStorage.DidNotReceive().SetNoWorkspaceStateReached(Arg.Any <bool>());
            }
Ejemplo n.º 3
0
            public async Task DoesNothingWhenNoWorkspacesAreFetched()
            {
                DataSource.Workspaces.GetAll().Returns(Observable.Return(new List <IThreadSafeWorkspace>()));

                await ViewModel.TryAgain();

                await NavigationService.DidNotReceive().Close(Arg.Is(ViewModel));

                AccessRestrictionStorage.DidNotReceive().SetNoWorkspaceStateReached(Arg.Any <bool>());
            }
Ejemplo n.º 4
0
            internal void ReturnsTrueButDoesNotNavigateOrSetUnathorizedAccessFlagWhenTheApiTokenCannotBeExtractedFromTheRequest()
            {
                var request = Substitute.For <IRequest>();

                request.Headers.Returns(new HttpHeader[0]);
                var exceptionWithoutApiToken = new UnauthorizedException(request, Substitute.For <IResponse>());

                var handled = ErrorHandlingService.TryHandleUnauthorizedError(exceptionWithoutApiToken);

                handled.Should().BeTrue();
                NavigationService.DidNotReceive().Navigate <TokenResetViewModel>();
                AccessRestrictionStorage.DidNotReceive().SetUnauthorizedAccess(Arg.Any <string>());
            }
Ejemplo n.º 5
0
            public void DoesNotRestrictAccessForDifferentExceptions()
            {
                ErrorHandlingService.TryHandleUnauthorizedError(exception);

                AccessRestrictionStorage.DidNotReceive().SetUnauthorizedAccess(Arg.Any <string>());
            }