Browse Source

Fix global.json to reference Arcade 7.0.0-beta.22513.4

pull/1564/head 4.0.0-preview5
Kévin Chalet 4 years ago
parent
commit
779a8524e4
  1. 4
      global.json
  2. 2
      test/OpenIddict.Abstractions.Tests/Primitives/OpenIddictConverterTests.cs
  3. 2
      test/OpenIddict.Abstractions.Tests/Primitives/OpenIddictMessageTests.cs
  4. 34
      test/OpenIddict.Abstractions.Tests/Primitives/OpenIddictParameterTests.cs
  5. 10
      test/OpenIddict.Server.AspNetCore.IntegrationTests/OpenIddictServerAspNetCoreIntegrationTests.cs
  6. 25
      test/OpenIddict.Server.IntegrationTests/OpenIddictServerIntegrationTests.Discovery.cs
  7. 2
      test/OpenIddict.Server.IntegrationTests/OpenIddictServerIntegrationTests.cs

4
global.json

@ -16,7 +16,7 @@
}, },
"msbuild-sdks": { "msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.21519.3", "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22513.4",
"Microsoft.DotNet.Helix.Sdk": "6.0.0-beta.21519.3" "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22513.4"
} }
} }

2
test/OpenIddict.Abstractions.Tests/Primitives/OpenIddictConverterTests.cs

@ -155,7 +155,7 @@ public class OpenIddictConverterTests
Assert.NotNull(message.GetParameter("string")); Assert.NotNull(message.GetParameter("string"));
Assert.NotNull(message.GetParameter("array")); Assert.NotNull(message.GetParameter("array"));
Assert.NotNull(message.GetParameter("object")); Assert.NotNull(message.GetParameter("object"));
Assert.Empty((string?) message.GetParameter("string")); Assert.Empty(((string?) message.GetParameter("string"))!);
Assert.NotNull((JsonElement?) message.GetParameter("array")); Assert.NotNull((JsonElement?) message.GetParameter("array"));
Assert.NotNull((JsonElement?) message.GetParameter("object")); Assert.NotNull((JsonElement?) message.GetParameter("object"));

2
test/OpenIddict.Abstractions.Tests/Primitives/OpenIddictMessageTests.cs

@ -196,7 +196,7 @@ public class OpenIddictMessageTests
#endif #endif
// Assert // Assert
Assert.Empty((string?) message.GetParameter("string")); Assert.Empty(((string?) message.GetParameter("string"))!);
Assert.NotNull((JsonElement?) message.GetParameter("array")); Assert.NotNull((JsonElement?) message.GetParameter("array"));
Assert.NotNull((JsonElement?) message.GetParameter("object")); Assert.NotNull((JsonElement?) message.GetParameter("object"));
Assert.NotNull((JsonElement?) message.GetParameter("value")); Assert.NotNull((JsonElement?) message.GetParameter("value"));

34
test/OpenIddict.Abstractions.Tests/Primitives/OpenIddictParameterTests.cs

@ -1148,8 +1148,12 @@ public class OpenIddictParameterTests
// Arrange // Arrange
var parameter = new OpenIddictParameter(); var parameter = new OpenIddictParameter();
// Act and assert // Act
Assert.Empty(parameter.ToString()); var result = parameter.ToString();
// Assert
Assert.NotNull(result);
Assert.Empty(result);
} }
[Fact] [Fact]
@ -1212,8 +1216,12 @@ public class OpenIddictParameterTests
var parameter = new OpenIddictParameter( var parameter = new OpenIddictParameter(
JsonSerializer.Deserialize<JsonElement>(@"{""field"":null}").GetProperty("field")); JsonSerializer.Deserialize<JsonElement>(@"{""field"":null}").GetProperty("field"));
// Act and assert // Act
Assert.Empty(parameter.ToString()); var result = parameter.ToString();
// Assert
Assert.NotNull(result);
Assert.Empty(result);
} }
[Fact] [Fact]
@ -1222,8 +1230,12 @@ public class OpenIddictParameterTests
// Arrange // Arrange
var parameter = new OpenIddictParameter(default(JsonElement)); var parameter = new OpenIddictParameter(default(JsonElement));
// Act and assert // Act
Assert.Empty(parameter.ToString()); var result = parameter.ToString();
// Assert
Assert.NotNull(result);
Assert.Empty(result);
} }
#if SUPPORTS_JSON_NODES #if SUPPORTS_JSON_NODES
@ -1233,8 +1245,12 @@ public class OpenIddictParameterTests
// Arrange // Arrange
var parameter = new OpenIddictParameter((JsonNode?) null); var parameter = new OpenIddictParameter((JsonNode?) null);
// Act and assert // Act
Assert.Empty(parameter.ToString()); var result = parameter.ToString();
// Assert
Assert.NotNull(result);
Assert.Empty(result);
} }
#endif #endif
@ -1699,7 +1715,7 @@ public class OpenIddictParameterTests
Assert.Equal(42L, ((JsonElement) new OpenIddictParameter(42)).GetInt64()); Assert.Equal(42L, ((JsonElement) new OpenIddictParameter(42)).GetInt64());
Assert.Equal(JsonValueKind.String, ((JsonElement) new OpenIddictParameter(string.Empty)).ValueKind); Assert.Equal(JsonValueKind.String, ((JsonElement) new OpenIddictParameter(string.Empty)).ValueKind);
Assert.Empty(((JsonElement) new OpenIddictParameter(string.Empty)).GetString()); Assert.Empty(((JsonElement) new OpenIddictParameter(string.Empty)).GetString()!);
Assert.Equal(JsonValueKind.String, ((JsonElement) new OpenIddictParameter("value")).ValueKind); Assert.Equal(JsonValueKind.String, ((JsonElement) new OpenIddictParameter("value")).ValueKind);
Assert.Equal("value", ((JsonElement) new OpenIddictParameter("value")).GetString()); Assert.Equal("value", ((JsonElement) new OpenIddictParameter("value")).GetString());

10
test/OpenIddict.Server.AspNetCore.IntegrationTests/OpenIddictServerAspNetCoreIntegrationTests.cs

@ -173,9 +173,9 @@ public partial class OpenIddictServerAspNetCoreIntegrationTests : OpenIddictServ
}); });
// Assert // Assert
Assert.NotEmpty(response.Error); Assert.NotNull(response.Error);
Assert.NotEmpty(response.ErrorDescription); Assert.NotNull(response.ErrorDescription);
Assert.NotEmpty(response.ErrorUri); Assert.NotNull(response.ErrorUri);
} }
[Fact] [Fact]
@ -813,7 +813,7 @@ public partial class OpenIddictServerAspNetCoreIntegrationTests : OpenIddictServ
}); });
// Assert // Assert
Assert.NotEmpty(response.AccessToken); Assert.NotNull(response.AccessToken);
} }
[Fact] [Fact]
@ -900,7 +900,7 @@ public partial class OpenIddictServerAspNetCoreIntegrationTests : OpenIddictServ
}); });
// Assert // Assert
Assert.NotEmpty(response.State); Assert.NotNull(response.State);
} }
[Fact] [Fact]

25
test/OpenIddict.Server.IntegrationTests/OpenIddictServerIntegrationTests.Discovery.cs

@ -432,6 +432,7 @@ public abstract partial class OpenIddictServerIntegrationTests
var methods = (string[]?) response[Metadata.TokenEndpointAuthMethodsSupported]; var methods = (string[]?) response[Metadata.TokenEndpointAuthMethodsSupported];
// Assert // Assert
Assert.NotNull(methods);
Assert.Contains(ClientAuthenticationMethods.ClientSecretBasic, methods); Assert.Contains(ClientAuthenticationMethods.ClientSecretBasic, methods);
Assert.Contains(ClientAuthenticationMethods.ClientSecretPost, methods); Assert.Contains(ClientAuthenticationMethods.ClientSecretPost, methods);
} }
@ -466,6 +467,7 @@ public abstract partial class OpenIddictServerIntegrationTests
var methods = (string[]?) response[Metadata.IntrospectionEndpointAuthMethodsSupported]; var methods = (string[]?) response[Metadata.IntrospectionEndpointAuthMethodsSupported];
// Assert // Assert
Assert.NotNull(methods);
Assert.Contains(ClientAuthenticationMethods.ClientSecretBasic, methods); Assert.Contains(ClientAuthenticationMethods.ClientSecretBasic, methods);
Assert.Contains(ClientAuthenticationMethods.ClientSecretPost, methods); Assert.Contains(ClientAuthenticationMethods.ClientSecretPost, methods);
} }
@ -500,6 +502,7 @@ public abstract partial class OpenIddictServerIntegrationTests
var methods = (string[]?) response[Metadata.RevocationEndpointAuthMethodsSupported]; var methods = (string[]?) response[Metadata.RevocationEndpointAuthMethodsSupported];
// Assert // Assert
Assert.NotNull(methods);
Assert.Contains(ClientAuthenticationMethods.ClientSecretBasic, methods); Assert.Contains(ClientAuthenticationMethods.ClientSecretBasic, methods);
Assert.Contains(ClientAuthenticationMethods.ClientSecretPost, methods); Assert.Contains(ClientAuthenticationMethods.ClientSecretPost, methods);
} }
@ -522,7 +525,8 @@ public abstract partial class OpenIddictServerIntegrationTests
var types = (string[]?) response[Metadata.GrantTypesSupported]; var types = (string[]?) response[Metadata.GrantTypesSupported];
// Assert // Assert
Assert.Equal(2, types?.Length); Assert.NotNull(types);
Assert.Equal(2, types.Length);
Assert.Contains(GrantTypes.AuthorizationCode, types); Assert.Contains(GrantTypes.AuthorizationCode, types);
Assert.Contains(GrantTypes.Password, types); Assert.Contains(GrantTypes.Password, types);
} }
@ -563,7 +567,8 @@ public abstract partial class OpenIddictServerIntegrationTests
var methods = (string[]?) response[Metadata.CodeChallengeMethodsSupported]; var methods = (string[]?) response[Metadata.CodeChallengeMethodsSupported];
// Assert // Assert
Assert.Equal(2, methods?.Length); Assert.NotNull(methods);
Assert.Equal(2, methods.Length);
Assert.Contains(CodeChallengeMethods.Sha256, methods); Assert.Contains(CodeChallengeMethods.Sha256, methods);
Assert.Contains(CodeChallengeMethods.Plain, methods); Assert.Contains(CodeChallengeMethods.Plain, methods);
} }
@ -604,7 +609,8 @@ public abstract partial class OpenIddictServerIntegrationTests
var modes = (string[]?) response[Metadata.ResponseModesSupported]; var modes = (string[]?) response[Metadata.ResponseModesSupported];
// Assert // Assert
Assert.Equal(2, modes?.Length); Assert.NotNull(modes);
Assert.Equal(2, modes.Length);
Assert.Contains(ResponseModes.FormPost, modes); Assert.Contains(ResponseModes.FormPost, modes);
Assert.Contains(ResponseModes.Fragment, modes); Assert.Contains(ResponseModes.Fragment, modes);
} }
@ -645,7 +651,8 @@ public abstract partial class OpenIddictServerIntegrationTests
var types = (string[]?) response[Metadata.ResponseTypesSupported]; var types = (string[]?) response[Metadata.ResponseTypesSupported];
// Assert // Assert
Assert.Equal(2, types?.Length); Assert.NotNull(types);
Assert.Equal(2, types.Length);
Assert.Contains(ResponseTypes.Code, types); Assert.Contains(ResponseTypes.Code, types);
Assert.Contains(ResponseTypes.Code + ' ' + ResponseTypes.IdToken, types); Assert.Contains(ResponseTypes.Code + ' ' + ResponseTypes.IdToken, types);
} }
@ -686,7 +693,8 @@ public abstract partial class OpenIddictServerIntegrationTests
var scopes = (string[]?) response[Metadata.ScopesSupported]; var scopes = (string[]?) response[Metadata.ScopesSupported];
// Assert // Assert
Assert.Equal(2, scopes?.Length); Assert.NotNull(scopes);
Assert.Equal(2, scopes.Length);
Assert.Contains(Scopes.OpenId, scopes); Assert.Contains(Scopes.OpenId, scopes);
Assert.Contains("custom_scope", scopes); Assert.Contains("custom_scope", scopes);
} }
@ -727,7 +735,8 @@ public abstract partial class OpenIddictServerIntegrationTests
var claims = (string[]?) response[Metadata.ClaimsSupported]; var claims = (string[]?) response[Metadata.ClaimsSupported];
// Assert // Assert
Assert.Equal(2, claims?.Length); Assert.NotNull(claims);
Assert.Equal(2, claims.Length);
Assert.Contains(Claims.Profile, claims); Assert.Contains(Claims.Profile, claims);
Assert.Contains("custom_claim", claims); Assert.Contains("custom_claim", claims);
} }
@ -744,6 +753,7 @@ public abstract partial class OpenIddictServerIntegrationTests
var types = (string[]?) response[Metadata.SubjectTypesSupported]; var types = (string[]?) response[Metadata.SubjectTypesSupported];
// Assert // Assert
Assert.NotNull(types);
Assert.Contains(SubjectTypes.Public, types); Assert.Contains(SubjectTypes.Public, types);
} }
@ -774,6 +784,7 @@ public abstract partial class OpenIddictServerIntegrationTests
var algorithms = (string[]?) response[Metadata.IdTokenSigningAlgValuesSupported]; var algorithms = (string[]?) response[Metadata.IdTokenSigningAlgValuesSupported];
// Assert // Assert
Assert.NotNull(algorithms);
Assert.Contains(algorithm, algorithms); Assert.Contains(algorithm, algorithms);
} }
@ -795,6 +806,7 @@ public abstract partial class OpenIddictServerIntegrationTests
var algorithms = (string[]?) response[Metadata.IdTokenSigningAlgValuesSupported]; var algorithms = (string[]?) response[Metadata.IdTokenSigningAlgValuesSupported];
// Assert // Assert
Assert.NotNull(algorithms);
Assert.Single(algorithms); Assert.Single(algorithms);
Assert.Contains(Algorithms.RsaSha256, algorithms); Assert.Contains(Algorithms.RsaSha256, algorithms);
} }
@ -820,6 +832,7 @@ public abstract partial class OpenIddictServerIntegrationTests
var algorithms = (string[]?) response[Metadata.IdTokenSigningAlgValuesSupported]; var algorithms = (string[]?) response[Metadata.IdTokenSigningAlgValuesSupported];
// Assert // Assert
Assert.NotNull(algorithms);
Assert.Single(algorithms); Assert.Single(algorithms);
} }

2
test/OpenIddict.Server.IntegrationTests/OpenIddictServerIntegrationTests.cs

@ -1758,7 +1758,7 @@ public abstract partial class OpenIddictServerIntegrationTests
{ {
builder.UseInlineHandler(context => builder.UseInlineHandler(context =>
{ {
Assert.Equal(new[] { Scopes.Profile }, context.AccessTokenPrincipal?.GetScopes()); Assert.Equal(new[] { Scopes.Profile }, context.AccessTokenPrincipal!.GetScopes());
return default; return default;
}); });

Loading…
Cancel
Save