Skip to content

Commit 1eb0385

Browse files
committed
Replace FluentAssertions with Shouldly
1 parent acc5584 commit 1eb0385

39 files changed

+1194
-1204
lines changed

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
3636
<PackageVersion Include="Duende.IdentityModel" Version="7.0.0" />
3737
<PackageVersion Include="Duende.IdentityServer" Version="$(IdentityServerVersion)" />
38-
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
3938
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.3.0" />
4039
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="$(FrameworkVersion)" />
4140
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="$(FrameworkVersion)" />
@@ -58,6 +57,7 @@
5857
<PackageVersion Include="SimpleExec" Version="12.0.0" />
5958
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="$(WilsonVersion)" />
6059
<PackageVersion Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="$(WilsonVersion)" />
60+
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
6161
<PackageVersion Include="System.Text.Json" Version="8.0.5" />
6262
<PackageVersion Include="Verify.Xunit" Version="27.0.1" />
6363
<PackageVersion Include="xunit.core" Version="2.9.2" />
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) Duende Software. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
33

4-
global using Xunit;
5-
global using Shouldly;
4+
global using Shouldly;
5+
global using Xunit;

identity-model-oidc-client/test/IdentityModel.OidcClient.Tests/AuthorizeRequestTests.cs

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// Copyright (c) Duende Software. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
33

4-
using Duende.IdentityModel.OidcClient.Browser;
5-
using FluentAssertions;
64
using Duende.IdentityModel.Client;
5+
using Duende.IdentityModel.OidcClient.Browser;
76

87
namespace Duende.IdentityModel.OidcClient
98
{
@@ -23,16 +22,16 @@ public void Default_parameters_should_be_used_for_authorize_request()
2322
var client = new AuthorizeClient(options);
2423
var parameters = client.CreateAuthorizeParameters("state", "code_challenge", null);
2524

26-
parameters.Should().HaveCount(9);
27-
parameters.GetValues("client_id").Single().Should().Be("client_id");
28-
parameters.GetValues("scope").Single().Should().Be("openid");
29-
parameters.GetValues("resource").First().Should().Be("urn:resource1");
30-
parameters.GetValues("resource").Skip(1).First().Should().Be("urn:resource2");
31-
parameters.GetValues("redirect_uri").Single().Should().Be("http://redirect");
32-
parameters.GetValues("response_type").Single().Should().Be("code");
33-
parameters.GetValues("state").Single().Should().Be("state");
34-
parameters.GetValues("code_challenge").Single().Should().Be("code_challenge");
35-
parameters.GetValues("code_challenge_method").Single().Should().Be("S256");
25+
parameters.Count.ShouldBe(9);
26+
parameters.GetValues("client_id").Single().ShouldBe("client_id");
27+
parameters.GetValues("scope").Single().ShouldBe("openid");
28+
parameters.GetValues("resource").First().ShouldBe("urn:resource1");
29+
parameters.GetValues("resource").Skip(1).First().ShouldBe("urn:resource2");
30+
parameters.GetValues("redirect_uri").Single().ShouldBe("http://redirect");
31+
parameters.GetValues("response_type").Single().ShouldBe("code");
32+
parameters.GetValues("state").Single().ShouldBe("state");
33+
parameters.GetValues("code_challenge").Single().ShouldBe("code_challenge");
34+
parameters.GetValues("code_challenge_method").Single().ShouldBe("S256");
3635
}
3736

3837
[Fact]
@@ -53,19 +52,19 @@ public void Missing_default_parameters_can_be_set_by_extra_parameters()
5352
var client = new AuthorizeClient(options);
5453
var parameters = client.CreateAuthorizeParameters("state", "code_challenge", frontChannel);
5554

56-
parameters.Should().HaveCount(9);
57-
parameters.GetValues("client_id").Single().Should().Be("client_id2");
58-
parameters.GetValues("scope").Single().Should().Be("openid extra");
59-
parameters.GetValues("redirect_uri").Single().Should().Be("http://redirect2");
60-
parameters.GetValues("response_type").Single().Should().Be("code");
61-
parameters.GetValues("state").Single().Should().Be("state");
62-
parameters.GetValues("code_challenge").Single().Should().Be("code_challenge");
63-
parameters.GetValues("code_challenge_method").Single().Should().Be("S256");
55+
parameters.Count.ShouldBe(9);
56+
parameters.GetValues("client_id").Single().ShouldBe("client_id2");
57+
parameters.GetValues("scope").Single().ShouldBe("openid extra");
58+
parameters.GetValues("redirect_uri").Single().ShouldBe("http://redirect2");
59+
parameters.GetValues("response_type").Single().ShouldBe("code");
60+
parameters.GetValues("state").Single().ShouldBe("state");
61+
parameters.GetValues("code_challenge").Single().ShouldBe("code_challenge");
62+
parameters.GetValues("code_challenge_method").Single().ShouldBe("S256");
6463

6564
var resources = parameters.GetValues("resource").ToList();
66-
resources.Should().HaveCount(2);
67-
resources[0].Should().Be("urn:resource1");
68-
resources[1].Should().Be("urn:resource2");
65+
resources.Count.ShouldBe(2);
66+
resources[0].ShouldBe("urn:resource1");
67+
resources[1].ShouldBe("urn:resource2");
6968
}
7069

7170
[Fact]
@@ -93,8 +92,8 @@ public async Task Browser_error_is_surfaced_in_authorize_response()
9392

9493
var response = await client.AuthorizeAsync(new AuthorizeRequest());
9594

96-
response.Error.Should().Be("Something terrible happened");
97-
response.ErrorDescription.Should().Be("Explaining the terrible error...");
95+
response.Error.ShouldBe("Something terrible happened");
96+
response.ErrorDescription.ShouldBe("Explaining the terrible error...");
9897
}
9998
}
10099
}

0 commit comments

Comments
 (0)