예제 #1
0
        public static void Validate_Throws_If_ClientSecret_Is_Null_With_No_Secret_Generation()
        {
            // Arrange
            var options = new AppleAuthenticationOptions()
            {
                ClientId     = "my-client-id",
                ClientSecret = null,
            };

            // Act and Assert
            Assert.Throws <ArgumentException>("ClientSecret", () => options.Validate());
        }
예제 #2
0
        public static void Validate_Throws_If_CallbackPath_Is_Null()
        {
            // Arrange
            var options = new AppleAuthenticationOptions()
            {
                ClientId             = "my-client-id",
                GenerateClientSecret = true,
                CallbackPath         = null,
            };

            // Act and Assert
            Assert.Throws <ArgumentException>("CallbackPath", () => options.Validate());
        }
예제 #3
0
        public static void Validate_Throws_If_AuthorizationEndpoint_Is_Null()
        {
            // Arrange
            var options = new AppleAuthenticationOptions()
            {
                ClientId              = "my-client-id",
                GenerateClientSecret  = true,
                AuthorizationEndpoint = null,
            };

            // Act and Assert
            Assert.Throws <ArgumentException>("AuthorizationEndpoint", () => options.Validate());
        }
예제 #4
0
        public static void Validate_Throws_If_PublicKeyEndpoint_Is_Null_With_Token_Validation()
        {
            // Arrange
            var options = new AppleAuthenticationOptions()
            {
                ClientId          = "my-client-id",
                ClientSecret      = "my-client-secret",
                PublicKeyEndpoint = null,
            };

            // Act and Assert
            Assert.Throws <ArgumentException>("PublicKeyEndpoint", () => options.Validate());
        }
예제 #5
0
        public static void Validate_Throws_If_TeamId_Is_Null_With_Secret_Generation()
        {
            // Arrange
            var options = new AppleAuthenticationOptions()
            {
                ClientId             = "my-client-id",
                GenerateClientSecret = true,
                KeyId  = "my-key-id",
                TeamId = null,
            };

            // Act and Assert
            Assert.Throws <ArgumentException>("TeamId", () => options.Validate());
        }
예제 #6
0
        public static void Validate_Throws_If_ClientSecretExpiresAfter_Is_Zero_With_Secret_Generation()
        {
            // Arrange
            var options = new AppleAuthenticationOptions()
            {
                ClientId             = "my-client-id",
                GenerateClientSecret = true,
                KeyId  = "my-key-id",
                TeamId = "my-team-id",
                ClientSecretExpiresAfter = TimeSpan.Zero,
            };

            // Act and Assert
            Assert.Throws <ArgumentOutOfRangeException>("ClientSecretExpiresAfter", () => options.Validate());
        }