Skip to content

Commit 1b1586e

Browse files
committed
fix: NRT on title lookup
Signed-off-by: Vincent Biret <[email protected]>
1 parent 45cfaa0 commit 1b1586e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiSchemaGeneratorTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,12 @@ public void CreateStructuredTypeSchemaForEntityTypeWithDiscriminatorValueEnabled
190190
// Act
191191
var schema = context.CreateStructuredTypeSchema(entity, new());
192192
var derivedSchema = context.CreateStructuredTypeSchema(derivedEntity, new());
193-
string json = schema.SerializeAsJson(OpenApiSpecVersion.OpenApi3_0);
193+
var json = JsonNode.Parse(schema.SerializeAsJson(OpenApiSpecVersion.OpenApi3_0));
194194

195195
// Assert
196196
Assert.True(derivedSchema.AllOf.FirstOrDefault(x => derivedType.Equals(x.Title))?.Properties.ContainsKey("@odata.type"));
197197
Assert.NotNull(json);
198-
Assert.Equal(@"{
198+
Assert.True(JsonNode.DeepEquals(JsonNode.Parse(@"{
199199
""allOf"": [
200200
{
201201
""$ref"": ""#/components/schemas/microsoft.graph.entity""
@@ -258,7 +258,7 @@ public void CreateStructuredTypeSchemaForEntityTypeWithDiscriminatorValueEnabled
258258
}
259259
}
260260
]
261-
}".ChangeLineBreaks(), json);
261+
}"), json));
262262
}
263263

264264
[Theory]

0 commit comments

Comments
 (0)