Skip to content

Commit 5c0764e

Browse files
committed
Reduced naming convention casing client tests to verifying generated CLR types
1 parent 786ab2a commit 5c0764e

File tree

2 files changed

+85
-6
lines changed

2 files changed

+85
-6
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
using FluentAssertions;
2+
using OpenApiClientTests.NamingConventions.KebabCase.GeneratedCode;
3+
using Xunit;
4+
5+
namespace OpenApiClientTests.NamingConventions.KebabCase
6+
{
7+
public sealed class GeneratedTypesTests
8+
{
9+
[Fact]
10+
public void Generated_code_is_named_as_expected()
11+
{
12+
nameof(KebabCaseClient.GetSupermarketCollectionAsync).Should().NotBeNull();
13+
nameof(KebabCaseClient.GetSupermarketCollectionAsync).Should().NotBeNull();
14+
nameof(KebabCaseClient.PostSupermarketAsync).Should().NotBeNull();
15+
nameof(KebabCaseClient.GetSupermarketAsync).Should().NotBeNull();
16+
nameof(KebabCaseClient.GetSupermarketAsync).Should().NotBeNull();
17+
nameof(KebabCaseClient.PatchSupermarketAsync).Should().NotBeNull();
18+
nameof(KebabCaseClient.DeleteSupermarketAsync).Should().NotBeNull();
19+
nameof(KebabCaseClient.GetSupermarketBackupStoreManagerAsync).Should().NotBeNull();
20+
nameof(KebabCaseClient.GetSupermarketBackupStoreManagerAsync).Should().NotBeNull();
21+
nameof(KebabCaseClient.GetSupermarketBackupStoreManagerRelationshipAsync).Should().NotBeNull();
22+
nameof(KebabCaseClient.GetSupermarketBackupStoreManagerRelationshipAsync).Should().NotBeNull();
23+
nameof(KebabCaseClient.PatchSupermarketBackupStoreManagerRelationshipAsync).Should().NotBeNull();
24+
nameof(KebabCaseClient.GetSupermarketCashiersAsync).Should().NotBeNull();
25+
nameof(KebabCaseClient.GetSupermarketCashiersAsync).Should().NotBeNull();
26+
nameof(KebabCaseClient.GetSupermarketCashiersRelationshipAsync).Should().NotBeNull();
27+
nameof(KebabCaseClient.GetSupermarketCashiersRelationshipAsync).Should().NotBeNull();
28+
nameof(KebabCaseClient.PostSupermarketCashiersRelationshipAsync).Should().NotBeNull();
29+
nameof(KebabCaseClient.PatchSupermarketCashiersRelationshipAsync).Should().NotBeNull();
30+
nameof(KebabCaseClient.DeleteSupermarketCashiersRelationshipAsync).Should().NotBeNull();
31+
nameof(KebabCaseClient.GetSupermarketStoreManagerAsync).Should().NotBeNull();
32+
nameof(KebabCaseClient.GetSupermarketStoreManagerAsync).Should().NotBeNull();
33+
nameof(KebabCaseClient.GetSupermarketStoreManagerRelationshipAsync).Should().NotBeNull();
34+
nameof(KebabCaseClient.GetSupermarketStoreManagerRelationshipAsync).Should().NotBeNull();
35+
nameof(KebabCaseClient.PatchSupermarketStoreManagerRelationshipAsync).Should().NotBeNull();
36+
37+
nameof(SupermarketCollectionResponseDocument).Should().NotBeNull();
38+
nameof(LinksInResourceCollectionDocument).Should().NotBeNull();
39+
nameof(JsonapiObject).Should().NotBeNull();
40+
nameof(SupermarketDataInResponse).Should().NotBeNull();
41+
nameof(SupermarketsResourceType).Should().NotBeNull();
42+
nameof(SupermarketAttributesInResponse.NameOfCity).Should().NotBeNull();
43+
nameof(SupermarketRelationshipsInResponse.StoreManager).Should().NotBeNull();
44+
nameof(SupermarketRelationshipsInResponse.BackupStoreManager).Should().NotBeNull();
45+
nameof(LinksInResourceObject).Should().NotBeNull();
46+
nameof(SupermarketType).Should().NotBeNull();
47+
nameof(KebabCaseClient.GetSupermarketAsync).Should().NotBeNull();
48+
nameof(ToOneStaffMemberResponseData).Should().NotBeNull();
49+
nameof(NullableToOneStaffMemberResponseData).Should().NotBeNull();
50+
nameof(ToManyStaffMemberResponseData).Should().NotBeNull();
51+
nameof(LinksInRelationshipObject).Should().NotBeNull();
52+
nameof(StaffMemberIdentifier).Should().NotBeNull();
53+
nameof(StaffMembersResourceType).Should().NotBeNull();
54+
nameof(StaffMembersResourceType.StaffMembers).Should().NotBeNull();
55+
nameof(SupermarketPrimaryResponseDocument).Should().NotBeNull();
56+
nameof(LinksInResourceDocument).Should().NotBeNull();
57+
nameof(StaffMemberSecondaryResponseDocument).Should().NotBeNull();
58+
nameof(StaffMemberDataInResponse).Should().NotBeNull();
59+
nameof(StaffMemberAttributesInResponse).Should().NotBeNull();
60+
nameof(NullableStaffMemberSecondaryResponseDocument).Should().NotBeNull();
61+
nameof(StaffMemberCollectionResponseDocument).Should().NotBeNull();
62+
nameof(StaffMemberIdentifierResponseDocument).Should().NotBeNull();
63+
nameof(LinksInResourceIdentifierDocument).Should().NotBeNull();
64+
nameof(NullableStaffMemberIdentifierResponseDocument).Should().NotBeNull();
65+
nameof(StaffMemberIdentifierCollectionResponseDocument).Should().NotBeNull();
66+
nameof(LinksInResourceIdentifierCollectionDocument).Should().NotBeNull();
67+
nameof(SupermarketPostRequestDocument).Should().NotBeNull();
68+
nameof(SupermarketDataInPostRequest).Should().NotBeNull();
69+
nameof(SupermarketAttributesInPostRequest).Should().NotBeNull();
70+
nameof(SupermarketRelationshipsInPostRequest).Should().NotBeNull();
71+
nameof(ToOneStaffMemberRequestData).Should().NotBeNull();
72+
nameof(NullableToOneStaffMemberRequestData).Should().NotBeNull();
73+
nameof(ToManyStaffMemberRequestData).Should().NotBeNull();
74+
nameof(SupermarketPatchRequestDocument).Should().NotBeNull();
75+
nameof(SupermarketDataInPatchRequest).Should().NotBeNull();
76+
nameof(SupermarketAttributesInPatchRequest).Should().NotBeNull();
77+
nameof(SupermarketRelationshipsInPatchRequest).Should().NotBeNull();
78+
}
79+
}
80+
}

test/OpenApiClientTests/OpenApiClientTests.csproj

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55

66
<ItemGroup>
77
<ProjectReference Include="..\..\src\JsonApiDotNetCore.OpenApi.Client\JsonApiDotNetCore.OpenApi.Client.csproj" />
8-
<ProjectReference Include="..\OpenApiTests\OpenApiTests.csproj" />
98
<ProjectReference Include="..\TestBuildingBlocks\TestBuildingBlocks.csproj" />
109
</ItemGroup>
1110

1211
<ItemGroup>
13-
<PackageReference Include="coverlet.collector" Version="$(CoverletVersion)" PrivateAssets="All"/>
14-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="$(AspNetCoreVersion)"/>
15-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)"/>
16-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>
12+
<PackageReference Include="coverlet.collector" Version="$(CoverletVersion)" PrivateAssets="All" />
13+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="$(AspNetCoreVersion)" />
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
15+
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
1716
<PackageReference Include="NSwag.ApiDescription.Client" Version="13.10.9">
1817
<PrivateAssets>all</PrivateAssets>
1918
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@@ -51,7 +50,7 @@
5150
<!-- Fixes IntelliSense errors on openapi.json in Visual Studio 2019, which uses the schema for OpenAPI 3.1 by default. -->
5251
<ProjectExtensions>
5352
<VisualStudio>
54-
<UserProperties swagger_1json__JsonSchema="https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.0/schema.json"/>
53+
<UserProperties swagger_1json__JsonSchema="https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.0/schema.json" />
5554
</VisualStudio>
5655
</ProjectExtensions>
5756
</Project>

0 commit comments

Comments
 (0)