Exemple #1
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());
    }
Exemple #2
0
    public static void Validate_Throws_If_KeyId_Is_Null_With_Secret_Generation()
    {
        // Arrange
        var options = new AppleAuthenticationOptions()
        {
            ClientId             = "my-client-id",
            GenerateClientSecret = true,
            KeyId = null,
        };

        // Act and Assert
        Assert.Throws <ArgumentException>("KeyId", () => options.Validate());
    }
Exemple #3
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());
    }