Skip to content

Commit 9bfab92

Browse files
committed
Merge branch 'master' into develop
2 parents 7ac2b6f + 0a16b06 commit 9bfab92

File tree

1 file changed

+38
-5
lines changed

1 file changed

+38
-5
lines changed

Abblix.Oidc.Server.UnitTests/Model/ClientRegistrationRequestTest.cs

+38-5
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,44 @@ namespace Abblix.Oidc.Server.UnitTests.Model;
2828

2929
public class ClientRegistrationRequestTest
3030
{
31-
[Theory]
32-
[InlineData(
33-
"{\"client_name\":\"dynamic_client_1 RqxLk9BdhK8qC3z\",\"grant_types\":[\"implicit\"],\"jwks\":{\"keys\":[{\"kty\":\"RSA\",\"e\":\"AQAB\",\"use\":\"sig\",\"alg\":\"RS256\",\"n\":\"gUOdYo2PpUUnZzozIPJ-7mK2Z5jYBxjj_5iB2TDnElt8yUc-mcCeOQrsaswPgKx2KMSJ50kwrFHHEuNyiDhgNMgtmJ98RuhggXaPF1fmmHss_Wc1OSqyGYLWbEzYGsRck5yTVP4xsPYAeP5xkkLze_FXJvwITNu2aGxXEYwokkrcWgL3AsXtYKClIwmacHhVNEMn-ALe3sMTifx4F8TqmNAlD4FPga094txHJNo2Ho6z4kn5L4uq_WXklDjaIDOqQZtdn0emXig3RHQcOtepFcXt7pcK9E2M3kxKFOMPpY8c4kaDfQ41jv23vbm9oDTh5s3TB0ZwcKJXj4-06gwTWw\"}]},\"token_endpoint_auth_method\":\"client_secret_basic\",\"response_types\":[\"id_token token\"],\"redirect_uris\":[\"https://www.certification.openid.net/test/a/Abblix/callback\"],\"contacts\":[\"[email protected]\"]}")]
34-
public void DeserializeClientRegistrationRequestTest(string json)
31+
[Fact]
32+
public void DeserializeClientRegistrationRequestTest()
3533
{
36-
JsonSerializer.Deserialize<ClientRegistrationRequest>(json);
34+
const string json =
35+
"""
36+
{
37+
"client_name": "dynamic_client_1 RqxLk9BdhK8qC3z",
38+
"grant_types": [
39+
"implicit"
40+
],
41+
"jwks": {
42+
"keys": [
43+
{
44+
"kty": "RSA",
45+
"e": "AQAB",
46+
"use": "sig",
47+
"alg": "RS256",
48+
"n": "gUOdYo2PpUUnZzozIPJ-7mK2Z5jYBxjj_5iB2TDnElt8yUc-mcCeOQrsaswPgKx2KMSJ50kwrFHHEuNyiDhgNMgtmJ98RuhggXaPF1fmmHss_Wc1OSqyGYLWbEzYGsRck5yTVP4xsPYAeP5xkkLze_FXJvwITNu2aGxXEYwokkrcWgL3AsXtYKClIwmacHhVNEMn-ALe3sMTifx4F8TqmNAlD4FPga094txHJNo2Ho6z4kn5L4uq_WXklDjaIDOqQZtdn0emXig3RHQcOtepFcXt7pcK9E2M3kxKFOMPpY8c4kaDfQ41jv23vbm9oDTh5s3TB0ZwcKJXj4-06gwTWw"
49+
}
50+
]
51+
},
52+
"token_endpoint_auth_method": "client_secret_basic",
53+
"response_types": [
54+
"id_token token"
55+
],
56+
"redirect_uris": [
57+
"https://www.certification.openid.net/test/a/Abblix/callback"
58+
],
59+
"contacts": [
60+
61+
]
62+
}
63+
""";
64+
var req = JsonSerializer.Deserialize<ClientRegistrationRequest>(json);
65+
Assert.NotNull(req);
66+
Assert.Equal("dynamic_client_1 RqxLk9BdhK8qC3z", req.ClientName);
67+
Assert.Equal(["implicit"], req.GrantTypes);
68+
Assert.Equal([["id_token", "token"]], req.ResponseTypes);
69+
Assert.Equal(["[email protected]"], req.Contacts);
3770
}
3871
}

0 commit comments

Comments
 (0)