Skip to content

Commit

Permalink
Fix Api test to the latest FluentAssertions
Browse files Browse the repository at this point in the history
  • Loading branch information
skoruba committed Dec 20, 2021
1 parent 2d21ee1 commit 935b6e7
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void CanMapApiResourceApiDtoToApiResourceDto()

apiResourceDto.Should().NotBeNull();

apiResourceApiDto.ShouldBeEquivalentTo(apiResourceDto);
apiResourceDto.Should().BeEquivalentTo(apiResourceApiDto);
}

[Fact]
Expand All @@ -29,7 +29,7 @@ public void CanMapApiResourceDtoToApiResourceApiDto()

var apiResourceApiDto = apiResourceDto.ToApiResourceApiModel<ApiResourceApiDto>();

apiResourceDto.ShouldBeEquivalentTo(apiResourceApiDto, options => options
apiResourceApiDto.Should().BeEquivalentTo(apiResourceDto, options => options
.Excluding(x => x.AllowedAccessTokenSigningAlgorithmsItems)
.Excluding(x=> x.ScopesItems)
.Excluding(x=> x.UserClaimsItems));
Expand All @@ -44,7 +44,7 @@ public void CanMapApiResourceSecretApiDtoToApiResourceSecretDto()

apiSecretApiDto.Id.Should().Be(apiSecretsDto.ApiSecretId);

apiSecretApiDto.ShouldBeEquivalentTo(apiSecretsDto, options => options.Excluding(x=> x.Id));
apiSecretsDto.Should().BeEquivalentTo(apiSecretApiDto, options => options.Excluding(x=> x.Id));
}

[Fact]
Expand All @@ -56,7 +56,7 @@ public void CanMapApiResourceSecretDtoToApiResourceSecretApiDto()

apiResourceSecret.ApiResourceId.Should().Be(apiResourceApiDto.Id);

apiResourceSecret.ShouldBeEquivalentTo(apiResourceApiDto, options =>
apiResourceApiDto.Should().BeEquivalentTo(apiResourceSecret, options =>
options.Excluding(x => x.ApiResourceId)
.Excluding(x => x.ApiSecrets)
.Excluding(x => x.ApiResourceName)
Expand All @@ -77,7 +77,7 @@ public void CanMapApiResourcePropertyApiDtoToApiResourcePropertyDto()

apiResourcePropertyApiDto.Id.Should().Be(apiResourcePropertiesDto.ApiResourcePropertyId);

apiResourcePropertyApiDto.ShouldBeEquivalentTo(apiResourcePropertiesDto, options => options.Excluding(x=> x.Id));
apiResourcePropertiesDto.Should().BeEquivalentTo(apiResourcePropertyApiDto, options => options.Excluding(x=> x.Id));
}

[Fact]
Expand All @@ -89,7 +89,7 @@ public void CanMapApiResourcePropertyDtoToApiResourcePropertyApiDto()

apiResourcePropertyDto.ApiResourcePropertyId.Should().Be(apiResourcePropertyApiDto.Id);

apiResourcePropertyDto.ShouldBeEquivalentTo(apiResourcePropertyApiDto, options =>
apiResourcePropertyApiDto.Should().BeEquivalentTo(apiResourcePropertyDto, options =>
options.Excluding(x => x.ApiResourceId)
.Excluding(x => x.ApiResourceName)
.Excluding(x => x.PageSize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void CanMapApiScopeApiDtoToApiScopeDto()

var apiScopeDto = apiScopeApiDto.ToApiScopeApiModel<ApiScopeDto>();

apiScopeApiDto.ShouldBeEquivalentTo(apiScopeDto, options => options.Excluding(x=> x.ApiScopeProperties));
apiScopeDto.Should().BeEquivalentTo(apiScopeApiDto, options => options.Excluding(x=> x.ApiScopeProperties));
}

[Fact]
Expand All @@ -27,7 +27,7 @@ public void CanMapApiScopeDtoToApiScopeApiDto()

var apiScopeApiDto = apiScopeDto.ToApiScopeApiModel<ApiScopeApiDto>();

apiScopeDto.ShouldBeEquivalentTo(apiScopeApiDto, options => options
apiScopeApiDto.Should().BeEquivalentTo(apiScopeDto, options => options
.Excluding(x => x.ApiScopeProperties)
.Excluding(x=> x.UserClaimsItems));
}
Expand All @@ -39,7 +39,7 @@ public void CanMapApiScopePropertyApiDtoToApiScopePropertyDto()

var apiScopePropertyDto = apiScopePropertyApiDto.ToApiScopeApiModel<ApiScopePropertyDto>();

apiScopePropertyApiDto.ShouldBeEquivalentTo(apiScopePropertyDto);
apiScopePropertyDto.Should().BeEquivalentTo(apiScopePropertyApiDto);
}

[Fact]
Expand All @@ -49,7 +49,7 @@ public void CanMapApiScopePropertyDtoToApiScopePropertyDto()

var apiScopePropertyApiDto = apiScopePropertyDto.ToApiScopeApiModel<ApiScopePropertyApiDto>();

apiScopePropertyDto.ShouldBeEquivalentTo(apiScopePropertyApiDto, options =>
apiScopePropertyApiDto.Should().BeEquivalentTo(apiScopePropertyDto, options =>
options.Excluding(x => x.ApiScopeId)
.Excluding(x => x.ApiScopeName)
.Excluding(x => x.PageSize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void CanMapClientApiDtoToClientDto()

clientDto.Should().NotBeNull();

clientApiDto.ShouldBeEquivalentTo(clientDto);
clientDto.Should().BeEquivalentTo(clientApiDto);
}

[Fact]
Expand All @@ -33,7 +33,7 @@ public void CanMapClientDtoToClientApiDto()

clientDto.Should().NotBeNull();

clientDto.ShouldBeEquivalentTo(clientApiDto, options =>
clientApiDto.Should().BeEquivalentTo(clientDto, options =>
options.Excluding(o => o.AllowedCorsOriginsItems)
.Excluding(o => o.AllowedGrantTypesItems)
.Excluding(o => o.AllowedIdentityTokenSigningAlgorithmsItems)
Expand All @@ -59,7 +59,7 @@ public void CanMapClientApiSecretToClientSecretDto()

clientSecretApi.Id.Should().Be(clientSecretsDto.ClientSecretId);

clientSecretApi.ShouldBeEquivalentTo(clientSecretsDto, options => options.Excluding(x => x.Id));
clientSecretsDto.Should().BeEquivalentTo(clientSecretApi, options => options.Excluding(x => x.Id));
}

[Fact]
Expand All @@ -71,7 +71,7 @@ public void CanMapClientSecretDtoToClientSecretApiDto()

clientSecretDto.ClientSecretId.Should().Be(clientSecretApiDto.Id);

clientSecretDto.ShouldBeEquivalentTo(clientSecretApiDto, options =>
clientSecretApiDto.Should().BeEquivalentTo(clientSecretDto, options =>
options.Excluding(x => x.ClientId)
.Excluding(x => x.ClientSecrets)
.Excluding(x => x.ClientName)
Expand All @@ -92,7 +92,7 @@ public void CanMapClientClaimApiDtoToClientClaimDto()

clientClaimApiDto.Id.Should().Be(clientClaimsDto.ClientClaimId);

clientClaimApiDto.ShouldBeEquivalentTo(clientClaimsDto, options => options.Excluding(x => x.Id));
clientClaimsDto.Should().BeEquivalentTo(clientClaimApiDto, options => options.Excluding(x => x.Id));
}

[Fact]
Expand All @@ -104,7 +104,7 @@ public void CanMapClientClaimDtoToClientClaimApiDto()

clientClaimDto.ClientClaimId.Should().Be(clientClaimApiDto.Id);

clientClaimDto.ShouldBeEquivalentTo(clientClaimApiDto, options =>
clientClaimApiDto.Should().BeEquivalentTo(clientClaimDto, options =>
options.Excluding(x => x.ClientClaims)
.Excluding(x => x.PageSize)
.Excluding(x => x.TotalCount)
Expand All @@ -121,8 +121,8 @@ public void CanMapClientPropertyApiDtoToClientPropertyDto()
var clientPropertiesDto = clientPropertyApiDto.ToClientApiModel<ClientPropertiesDto>();

clientPropertyApiDto.Id.Should().Be(clientPropertiesDto.ClientPropertyId);
clientPropertyApiDto.ShouldBeEquivalentTo(clientPropertiesDto, options => options.Excluding(x => x.Id));

clientPropertiesDto.Should().BeEquivalentTo(clientPropertyApiDto, options => options.Excluding(x => x.Id));
}

[Fact]
Expand All @@ -134,7 +134,7 @@ public void CanMapClientPropertyDtoToClientPropertyApiDto()

clientPropertyDto.ClientPropertyId.Should().Be(clientPropertyApiDto.Id);

clientPropertyDto.ShouldBeEquivalentTo(clientPropertyApiDto, options =>
clientPropertyApiDto.Should().BeEquivalentTo(clientPropertyDto, options =>
options.Excluding(x=> x.ClientId)
.Excluding(x=> x.ClientName)
.Excluding(x=> x.PageSize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void CanMapIdentityResourceApiDtoToIdentityResourceDto()

identityResourceDto.Should().NotBeNull();

identityResourceApiDto.ShouldBeEquivalentTo(identityResourceDto);
identityResourceDto.Should().BeEquivalentTo(identityResourceApiDto);
}

[Fact]
Expand All @@ -30,7 +30,7 @@ public void CanMapIdentityResourceDtoToIdentityResourceApiDto()

var identityResourceApiDto = identityResourceDto.ToIdentityResourceApiModel<IdentityResourceApiDto>();

identityResourceDto.ShouldBeEquivalentTo(identityResourceApiDto, options => options
identityResourceApiDto.Should().BeEquivalentTo(identityResourceDto, options => options
.Excluding(x => x.UserClaimsItems));
}

Expand All @@ -43,7 +43,7 @@ public void CanMapIdentityResourcePropertyApiDtoToIdentityResourcePropertyDto()

identityResourcePropertyApiDto.Id.Should().Be(identityResourcePropertiesDto.IdentityResourcePropertyId);

identityResourcePropertyApiDto.ShouldBeEquivalentTo(identityResourcePropertiesDto, options => options.Excluding(x => x.Id));
identityResourcePropertiesDto.Should().BeEquivalentTo(identityResourcePropertyApiDto, options => options.Excluding(x => x.Id));
}

[Fact]
Expand All @@ -55,7 +55,7 @@ public void CanMapIdentityResourcePropertyDtoToIdentityResourcePropertyApiDto()

identityResourcePropertyDto.IdentityResourcePropertyId.Should().Be(identityResourcePropertyApiDto.Id);

identityResourcePropertyDto.ShouldBeEquivalentTo(identityResourcePropertyApiDto, options =>
identityResourcePropertyApiDto.Should().BeEquivalentTo(identityResourcePropertyDto, options =>
options.Excluding(x => x.IdentityResourceId)
.Excluding(x => x.IdentityResourceName)
.Excluding(x => x.PageSize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void CanMapKeyDtoToKayApiDto()

var keyApi = keyDto.ToKeyApiModel<KeyApiDto>();

keyDto.ShouldBeEquivalentTo(keyApi);
keyApi.Should().BeEquivalentTo(keyDto);
}

[Fact]
Expand All @@ -28,7 +28,7 @@ public void CanMapKeyApiDtoToKeyDto()

var keyDto = keyApiDto.ToKeyApiModel<KeyDto>();

keyApiDto.ShouldBeEquivalentTo(keyDto);
keyDto.Should().BeEquivalentTo(keyApiDto);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void CanMapPersistedGrantDtoToPersistedGrantSubjectsApiDto()

var persistedGrantSubjectsApiDto = persistedGrantsDto.ToPersistedGrantApiModel<PersistedGrantSubjectsApiDto>();

persistedGrantsDto.ShouldBeEquivalentTo(persistedGrantSubjectsApiDto, options => options.Excluding(x=> x.SubjectId));
persistedGrantSubjectsApiDto.Should().BeEquivalentTo(persistedGrantsDto, options => options.Excluding(x=> x.SubjectId));
}

[Fact]
Expand All @@ -35,7 +35,7 @@ public void CanMapPersistedGrantDtoToPersistedGrantsApiDto()

var persistedGrantsApiDto = persistedGrantsDto.ToPersistedGrantApiModel<PersistedGrantsApiDto>();

persistedGrantsDto.ShouldBeEquivalentTo(persistedGrantsApiDto, options => options.Excluding(x => x.SubjectId));
persistedGrantsApiDto.Should().BeEquivalentTo(persistedGrantsDto, options => options.Excluding(x => x.SubjectId));
}

[Fact]
Expand All @@ -45,7 +45,7 @@ public void CanMapPersistedGrantDtoToPersistedGrantApiDto()

var persistedGrantApiDto = persistedGrantDto.ToPersistedGrantApiModel<PersistedGrantApiDto>();

persistedGrantDto.ShouldBeEquivalentTo(persistedGrantApiDto, options => options.Excluding(x => x.SubjectId));
persistedGrantApiDto.Should().BeEquivalentTo(persistedGrantDto, options => options.Excluding(x => x.SubjectId));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PackageReference>
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
<PackageReference Include="Bogus" Version="34.0.1" />
<PackageReference Include="FluentAssertions" Version="4.19.4" />
<PackageReference Include="FluentAssertions" Version="6.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Moq" Version="4.16.1" />
</ItemGroup>
Expand Down

0 comments on commit 935b6e7

Please sign in to comment.