public void IsAuthorized_RequestNullSessionNull_ReturnsFalse()
        {
            var provider = new UserAuthProvider(new TestIdentityServerAuthProviderSettings());

            // Act
            var result = provider.IsAuthorized(null, null);

            result.Should().Be(false);
        }
        public void IsAuthorized_RequestNull_SessionNotAuthenticated_ReturnsFalse()
        {
            var authSessionFake = A.Fake <IAuthSession>();
            var authTokenFake   = A.Fake <IAuthTokens>();

            authSessionFake.IsAuthenticated = false;

            var provider = new UserAuthProvider(new TestIdentityServerAuthProviderSettings());

            // Act
            var result = provider.IsAuthorized(authSessionFake, authTokenFake);

            result.Should().Be(false);
        }
        public void IsAuthorized_RequestNull_SessionAuthenticated_AccessTokenValid_ReturnsTrue()
        {
            // Arrange
            var authSessionFake = A.Fake <IAuthSession>();
            var authTokenFake   = A.Fake <IAuthTokens>();

            authSessionFake.IsAuthenticated = true;
            authTokenFake.AccessToken       = "A12345";

            var provider = new UserAuthProvider(new TestIdentityServerAuthProviderSettings());

            // Act
            var result = provider.IsAuthorized(authSessionFake, authTokenFake);

            result.Should().Be(true);
        }