Skip to content

Commit a46e660

Browse files
committed
tests: aligns tests with latest changes
Signed-off-by: Vincent Biret <[email protected]>
1 parent 1697bff commit a46e660

File tree

5 files changed

+177
-187
lines changed

5 files changed

+177
-187
lines changed

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

Lines changed: 43 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -368,75 +368,71 @@ public async Task CreateStructuredTypePropertiesSchemaWithCustomAttributeReturns
368368

369369
// Assert
370370
Assert.NotNull(json);
371-
Assert.True(JsonObject.DeepEquals(JsonObject.Parse(@"{
372-
""allOf"": [
371+
Assert.True(JsonNode.DeepEquals(JsonNode.Parse(
372+
"""
373+
{
374+
"allOf": [
373375
{
374-
""$ref"": ""#/components/schemas/microsoft.graph.entity""
376+
"$ref": "#/components/schemas/microsoft.graph.entity"
375377
},
376378
{
377-
""title"": ""userSettings"",
378-
""type"": ""object"",
379-
""properties"": {
380-
""contributionToContentDiscoveryAsOrganizationDisabled"": {
381-
""type"": ""boolean"",
382-
""description"": ""Reflects the Office Delve organization level setting. When set to true, the organization doesn't have access to Office Delve. This setting is read-only and can only be changed by administrators in the SharePoint admin center.""
379+
"title": "userSettings",
380+
"type": "object",
381+
"properties": {
382+
"contributionToContentDiscoveryAsOrganizationDisabled": {
383+
"type": "boolean",
384+
"description": "Reflects the Office Delve organization level setting. When set to true, the organization doesn't have access to Office Delve. This setting is read-only and can only be changed by administrators in the SharePoint admin center."
383385
},
384-
""contributionToContentDiscoveryDisabled"": {
385-
""type"": ""boolean"",
386-
""description"": ""When set to true, documents in the user's Office Delve are disabled. Users can control this setting in Office Delve.""
386+
"contributionToContentDiscoveryDisabled": {
387+
"type": "boolean",
388+
"description": "When set to true, documents in the user's Office Delve are disabled. Users can control this setting in Office Delve."
387389
},
388-
""itemInsights"": {
389-
""anyOf"": [
390+
"itemInsights": {
391+
"anyOf": [
390392
{
391-
""$ref"": ""#/components/schemas/microsoft.graph.userInsightsSettings""
392-
},
393-
{
394-
""nullable"": true
393+
"$ref": "#/components/schemas/microsoft.graph.userInsightsSettings"
395394
}
396395
],
397-
""description"": ""The user's settings for the visibility of meeting hour insights, and insights derived between a user and other items in Microsoft 365, such as documents or sites. Get userInsightsSettings through this navigation property."",
398-
""x-ms-navigationProperty"": true
396+
"description": "The user's settings for the visibility of meeting hour insights, and insights derived between a user and other items in Microsoft 365, such as documents or sites. Get userInsightsSettings through this navigation property.",
397+
"nullable": true,
398+
"x-ms-navigationProperty": true
399399
},
400-
""contactMergeSuggestions"": {
401-
""anyOf"": [
400+
"contactMergeSuggestions": {
401+
"anyOf": [
402402
{
403-
""$ref"": ""#/components/schemas/microsoft.graph.contactMergeSuggestions""
404-
},
405-
{
406-
""nullable"": true
403+
"$ref": "#/components/schemas/microsoft.graph.contactMergeSuggestions"
407404
}
408405
],
409-
""description"": ""The user's settings for the visibility of merge suggestion for the duplicate contacts in the user's contact list."",
410-
""x-ms-navigationProperty"": true
406+
"description": "The user's settings for the visibility of merge suggestion for the duplicate contacts in the user's contact list.",
407+
"nullable": true,
408+
"x-ms-navigationProperty": true
411409
},
412-
""regionalAndLanguageSettings"": {
413-
""anyOf"": [
414-
{
415-
""$ref"": ""#/components/schemas/microsoft.graph.regionalAndLanguageSettings""
416-
},
410+
"regionalAndLanguageSettings": {
411+
"anyOf": [
417412
{
418-
""nullable"": true
413+
"$ref": "#/components/schemas/microsoft.graph.regionalAndLanguageSettings"
419414
}
420415
],
421-
""description"": ""The user's preferences for languages, regional locale and date/time formatting."",
422-
""x-ms-navigationProperty"": true
416+
"description": "The user's preferences for languages, regional locale and date/time formatting.",
417+
"nullable": true,
418+
"x-ms-navigationProperty": true
423419
},
424-
""shiftPreferences"": {
425-
""anyOf"": [
426-
{
427-
""$ref"": ""#/components/schemas/microsoft.graph.shiftPreferences""
428-
},
420+
"shiftPreferences": {
421+
"anyOf": [
429422
{
430-
""nullable"": true
423+
"$ref": "#/components/schemas/microsoft.graph.shiftPreferences"
431424
}
432425
],
433-
""description"": ""The shift preferences for the user."",
434-
""x-ms-navigationProperty"": true
426+
"description": "The shift preferences for the user.",
427+
"nullable": true,
428+
"x-ms-navigationProperty": true
435429
}
436430
}
437431
}
438432
]
439-
}"), JsonObject.Parse(json)));
433+
}
434+
"""
435+
), JsonNode.Parse(json)));
440436
}
441437

442438
[Fact]
@@ -920,12 +916,10 @@ public async Task CreatePropertySchemaForNullableEnumPropertyReturnSchema(OpenAp
920916
"anyOf": [
921917
{
922918
"$ref": "#/components/schemas/DefaultNs.Color"
923-
},
924-
{
925-
"nullable": true
926919
}
927920
],
928-
"default": "yellow"
921+
"default": "yellow",
922+
"nullable": true
929923
}
930924
""",
931925
OpenApiSpecVersion.OpenApi3_1 =>

test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json

Lines changed: 26 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5017,14 +5017,13 @@
50175017
"format": "int32"
50185018
},
50195019
"Document": {
5020+
"type": "object",
50205021
"anyOf": [
50215022
{
50225023
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.Document"
5023-
},
5024-
{
5025-
"nullable": true
50265024
}
50275025
],
5026+
"nullable": true,
50285027
"x-ms-navigationProperty": true
50295028
}
50305029
},
@@ -5365,36 +5364,33 @@
53655364
}
53665365
},
53675366
"Library": {
5367+
"type": "object",
53685368
"anyOf": [
53695369
{
53705370
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Library.Library"
5371-
},
5372-
{
5373-
"nullable": true
53745371
}
53755372
],
5373+
"nullable": true,
53765374
"x-ms-navigationProperty": true
53775375
},
53785376
"LastRevisionFile": {
5377+
"type": "object",
53795378
"anyOf": [
53805379
{
53815380
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.DocumentFile.DocumentFile"
5382-
},
5383-
{
5384-
"nullable": true
53855381
}
53865382
],
5383+
"nullable": true,
53875384
"x-ms-navigationProperty": true
53885385
},
53895386
"SourceDocument": {
5387+
"type": "object",
53905388
"anyOf": [
53915389
{
53925390
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.Document"
5393-
},
5394-
{
5395-
"nullable": true
53965391
}
53975392
],
5393+
"nullable": true,
53985394
"x-ms-navigationProperty": true
53995395
},
54005396
"SourceDocumentChildren": {
@@ -5536,14 +5532,13 @@
55365532
"type": "boolean"
55375533
},
55385534
"Document": {
5535+
"type": "object",
55395536
"anyOf": [
55405537
{
55415538
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.Document"
5542-
},
5543-
{
5544-
"nullable": true
55455539
}
55465540
],
5541+
"nullable": true,
55475542
"x-ms-navigationProperty": true
55485543
}
55495544
},
@@ -5606,25 +5601,23 @@
56065601
"format": "date-time"
56075602
},
56085603
"Document": {
5604+
"type": "object",
56095605
"anyOf": [
56105606
{
56115607
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.Document"
5612-
},
5613-
{
5614-
"nullable": true
56155608
}
56165609
],
5610+
"nullable": true,
56175611
"x-ms-navigationProperty": true
56185612
},
56195613
"Tag": {
5614+
"type": "object",
56205615
"anyOf": [
56215616
{
56225617
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Tags.Tag"
5623-
},
5624-
{
5625-
"nullable": true
56265618
}
56275619
],
5620+
"nullable": true,
56285621
"x-ms-navigationProperty": true
56295622
}
56305623
},
@@ -5865,36 +5858,33 @@
58655858
"format": "int32"
58665859
},
58675860
"LibraryParent": {
5861+
"type": "object",
58685862
"anyOf": [
58695863
{
58705864
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Library.Library"
5871-
},
5872-
{
5873-
"nullable": true
58745865
}
58755866
],
5867+
"nullable": true,
58765868
"x-ms-navigationProperty": true
58775869
},
58785870
"Type": {
5871+
"type": "object",
58795872
"anyOf": [
58805873
{
58815874
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Library.LibraryType"
5882-
},
5883-
{
5884-
"nullable": true
58855875
}
58865876
],
5877+
"nullable": true,
58875878
"x-ms-navigationProperty": true
58885879
},
58895880
"SourceFolder": {
5881+
"type": "object",
58905882
"anyOf": [
58915883
{
58925884
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Library.Library"
5893-
},
5894-
{
5895-
"nullable": true
58965885
}
58975886
],
5887+
"nullable": true,
58985888
"x-ms-navigationProperty": true
58995889
},
59005890
"Documents": {
@@ -6065,25 +6055,23 @@
60656055
"type": "boolean"
60666056
},
60676057
"MasterLibraryType": {
6058+
"type": "object",
60686059
"anyOf": [
60696060
{
60706061
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Library.LibraryType"
6071-
},
6072-
{
6073-
"nullable": true
60746062
}
60756063
],
6064+
"nullable": true,
60766065
"x-ms-navigationProperty": true
60776066
},
60786067
"ParentLibraryTypes": {
6068+
"type": "object",
60796069
"anyOf": [
60806070
{
60816071
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Library.LibraryType"
6082-
},
6083-
{
6084-
"nullable": true
60856072
}
60866073
],
6074+
"nullable": true,
60876075
"x-ms-navigationProperty": true
60886076
},
60896077
"MasterLibraryTypeChildren": {
@@ -6591,14 +6579,13 @@
65916579
"nullable": true
65926580
},
65936581
"Document": {
6582+
"type": "object",
65946583
"anyOf": [
65956584
{
65966585
"$ref": "#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.Document"
6597-
},
6598-
{
6599-
"nullable": true
66006586
}
66016587
],
6588+
"nullable": true,
66026589
"x-ms-navigationProperty": true
66036590
}
66046591
},

0 commit comments

Comments
 (0)