示例#1
0
    public void GetClaimValueAsDouble_ShouldThrowAnExceptionWhenClaimTypeIsEmptyString()
    {
        var principal = CreatePrincipal("ClaimType", "TestValue");

        Should.Throw <ArgumentException>(() => ClaimsPrincipalExtensions.GetClaimValueAsDouble(principal, string.Empty));
    }
示例#2
0
    public void GetClaimValueAsDecimal_ShouldThrowAnExceptionWhenClaimTypeIsNull()
    {
        var principal = CreatePrincipal("ClaimType", "TestValue");

        Should.Throw <ArgumentException>(() => ClaimsPrincipalExtensions.GetClaimValueAsDecimal(principal, null !));
    }