Skip to content

Commit 94d8c8a

Browse files
committed
Clean up tests
1 parent 964b751 commit 94d8c8a

File tree

5 files changed

+25
-26
lines changed

5 files changed

+25
-26
lines changed

test/Microsoft.OpenApi.Readers.Tests/V31Tests/OpenApiDocumentTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Generic;
22
using System.Globalization;
33
using System.IO;
44
using FluentAssertions;
@@ -69,8 +69,8 @@ public void ParseDocumentWithWebhooksShouldSucceed()
6969
{
7070
Schemas =
7171
{
72-
["pet1"] = petSchema,
73-
["newPet1"] = newPetSchema
72+
["petSchema"] = petSchema,
73+
["newPetSchema"] = newPetSchema
7474
}
7575
};
7676

test/Microsoft.OpenApi.Readers.Tests/V31Tests/Samples/OpenApiDocument/documentWithWebhooks.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,30 @@ webhooks:
3131
schema:
3232
type: array
3333
items:
34-
"$ref": '#/components/schemas/pet1'
34+
"$ref": '#/components/schemas/petSchema'
3535
application/xml:
3636
schema:
3737
type: array
3838
items:
39-
"$ref": '#/components/schemas/pet1'
39+
"$ref": '#/components/schemas/petSchema'
4040
post:
4141
requestBody:
4242
description: Information about a new pet in the system
4343
required: true
4444
content:
4545
'application/json':
4646
schema:
47-
"$ref": '#/components/schemas/newPet1'
47+
"$ref": '#/components/schemas/newPetSchema'
4848
responses:
4949
"200":
5050
description: Return a 200 status to indicate that the data was received successfully
5151
content:
5252
application/json:
5353
schema:
54-
$ref: '#/components/schemas/pet1'
54+
$ref: '#/components/schemas/petSchema'
5555
components:
5656
schemas:
57-
pet1:
57+
petSchema:
5858
type: object
5959
required:
6060
- id
@@ -67,7 +67,7 @@ components:
6767
type: string
6868
tag:
6969
type: string
70-
newPet1:
70+
newPetSchema:
7171
type: object
7272
required:
7373
- name

test/Microsoft.OpenApi.Readers.Tests/V3Tests/JsonSchemaTests.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,9 @@ public void ParseBasicSchemaWithReferenceShouldSucceed()
224224
}
225225
});
226226

227-
components.Should().BeEquivalentTo(
228-
new OpenApiComponents
229-
{
230-
Schemas =
227+
var expectedComponents = new OpenApiComponents
228+
{
229+
Schemas =
231230
{
232231
["ErrorModel"] = new JsonSchemaBuilder()
233232
.Ref("#/components/schemas/ErrorModel")
@@ -240,7 +239,7 @@ public void ParseBasicSchemaWithReferenceShouldSucceed()
240239
.Ref("#/components/schemas/ExtendedErrorModel")
241240
.AllOf(
242241
new JsonSchemaBuilder()
243-
.Ref("#/components/schemas/ExtendedErrorModel")
242+
.Ref("#/components/schemas/ErrorModel")
244243
.Type(SchemaValueType.Object)
245244
.Properties(
246245
("code", new JsonSchemaBuilder().Type(SchemaValueType.Integer).Minimum(100).Maximum(600)),
@@ -251,9 +250,9 @@ public void ParseBasicSchemaWithReferenceShouldSucceed()
251250
.Required("rootCause")
252251
.Properties(("rootCause", new JsonSchemaBuilder().Type(SchemaValueType.String))))
253252
}
254-
},
255-
options => options.Excluding(m => m.Name == "HostDocument")
256-
.IgnoringCyclicReferences());
253+
};
254+
255+
components.Should().BeEquivalentTo(expectedComponents);
257256
}
258257

259258
[Fact]

test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiDocumentTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ public void ParseStandardPetStoreDocumentShouldSucceed()
223223
{
224224
Schemas = new Dictionary<string, JsonSchema>
225225
{
226-
["pet"] = new JsonSchemaBuilder()
227-
.Ref("#/components/schemas/pet")
226+
["pet1"] = new JsonSchemaBuilder()
227+
.Ref("#/components/schemas/pet1")
228228
.Type(SchemaValueType.Object)
229229
.Required("id", "name")
230230
.Properties(
@@ -249,7 +249,7 @@ public void ParseStandardPetStoreDocumentShouldSucceed()
249249
}
250250
};
251251

252-
var petSchema = components.Schemas["pet"];
252+
var petSchema = components.Schemas["pet1"];
253253

254254
var newPetSchema = components.Schemas["newPet"];
255255

test/Microsoft.OpenApi.Readers.Tests/V3Tests/Samples/OpenApiDocument/petStore.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ paths:
4242
schema:
4343
type: array
4444
items:
45-
"$ref": '#/components/schemas/pet'
45+
"$ref": '#/components/schemas/pet1'
4646
application/xml:
4747
schema:
4848
type: array
4949
items:
50-
"$ref": '#/components/schemas/pet'
50+
"$ref": '#/components/schemas/pet1'
5151

5252
'4XX':
5353
description: unexpected client error
@@ -77,7 +77,7 @@ paths:
7777
content:
7878
application/json:
7979
schema:
80-
"$ref": '#/components/schemas/pet'
80+
"$ref": '#/components/schemas/pet1'
8181
'4XX':
8282
description: unexpected client error
8383
content:
@@ -108,10 +108,10 @@ paths:
108108
content:
109109
application/json:
110110
schema:
111-
"$ref": '#/components/schemas/pet'
111+
"$ref": '#/components/schemas/pet1'
112112
application/xml:
113113
schema:
114-
"$ref": '#/components/schemas/pet'
114+
"$ref": '#/components/schemas/pet1'
115115
'4XX':
116116
description: unexpected client error
117117
content:
@@ -152,7 +152,7 @@ paths:
152152
"$ref": '#/components/schemas/errorModel'
153153
components:
154154
schemas:
155-
pet:
155+
pet1:
156156
type: object
157157
required:
158158
- id

0 commit comments

Comments
 (0)