@@ -63,7 +63,7 @@ public void ParseDocumentFromInlineStringShouldSucceed()
6363 Version = "0.9.1"
6464 } ,
6565 Paths = new OpenApiPaths ( )
66- } , result . Document , " Workspace" , " BaseUri" ) ;
66+ } , result . Document , nameof ( OpenApiDocument . Workspace ) , nameof ( OpenApiDocument . BaseUri ) ) ;
6767
6868 Assert . Equivalent (
6969 new OpenApiDiagnostic ( )
@@ -117,7 +117,7 @@ public async Task ParseBasicDocumentWithMultipleServersShouldSucceed()
117117 }
118118 ] ,
119119 Paths = new OpenApiPaths ( )
120- } , result . Document , " Workspace" , " BaseUri" ) ;
120+ } , result . Document , nameof ( OpenApiDocument . Workspace ) , nameof ( OpenApiDocument . BaseUri ) ) ;
121121 }
122122 [ Fact ]
123123 public async Task ParseBrokenMinimalDocumentShouldYieldExpectedDiagnostic ( )
@@ -138,7 +138,7 @@ public async Task ParseBrokenMinimalDocumentShouldYieldExpectedDiagnostic()
138138 Version = "0.9"
139139 } ,
140140 Paths = new OpenApiPaths ( )
141- } , result . Document , " Workspace" , " BaseUri" ) ;
141+ } , result . Document , nameof ( OpenApiDocument . Workspace ) , nameof ( OpenApiDocument . BaseUri ) ) ;
142142
143143 Assert . Equivalent (
144144 new OpenApiDiagnostic
@@ -200,7 +200,7 @@ public async Task ParseMinimalDocumentShouldSucceed()
200200 Version = "0.9.1"
201201 } ,
202202 Paths = new OpenApiPaths ( )
203- } , result . Document , " Workspace" , " BaseUri" ) ;
203+ } , result . Document , nameof ( OpenApiDocument . Workspace ) , nameof ( OpenApiDocument . BaseUri ) ) ;
204204
205205 Assert . Equivalent (
206206 new OpenApiDiagnostic ( )
@@ -590,7 +590,7 @@ public async Task ParseStandardPetStoreDocumentShouldSucceed()
590590 Components = components
591591 } ;
592592
593- OpenApiTestAssert . Equivalent ( expectedDoc , actual . Document , " Workspace" , " BaseUri" ) ;
593+ OpenApiTestAssert . Equivalent ( expectedDoc , actual . Document , nameof ( OpenApiDocument . Workspace ) , nameof ( OpenApiDocument . BaseUri ) ) ;
594594
595595 Assert . Equivalent (
596596 new OpenApiDiagnostic ( ) { SpecificationVersion = OpenApiSpecVersion . OpenApi3_0 , Format = OpenApiConstants . Yaml } , actual . Diagnostic ) ;
@@ -1060,9 +1060,9 @@ [new OpenApiSecuritySchemeReference("securitySchemeName2")] =
10601060 expected . SetReferenceHostDocument ( ) ;
10611061
10621062 OpenApiTestAssert . Equivalent ( expected , actual . Document , path =>
1063- path . MemberName is " Workspace" or " BaseUri"
1064- || path . Value . Contains ( " Paths[/pets].Operations[ Get]. Tags")
1065- || path . Value . Contains ( " Paths[/pets].Operations[ Post]. Tags") ) ;
1063+ path . MemberName is nameof ( OpenApiDocument . Workspace ) or nameof ( OpenApiDocument . BaseUri )
1064+ || path . Value . Contains ( $ " { nameof ( OpenApiDocument . Paths ) } [/pets].{ nameof ( OpenApiPathItem . Operations ) } [ { HttpMethod . Get } ]. { nameof ( OpenApiOperation . Tags ) } ")
1065+ || path . Value . Contains ( $ " { nameof ( OpenApiDocument . Paths ) } [/pets].{ nameof ( OpenApiPathItem . Operations ) } [ { HttpMethod . Post } ]. { nameof ( OpenApiOperation . Tags ) } ") ) ;
10661066
10671067 Assert . Equivalent (
10681068 new OpenApiDiagnostic ( ) { SpecificationVersion = OpenApiSpecVersion . OpenApi3_0 , Format = OpenApiConstants . Yaml } , actual . Diagnostic ) ;
@@ -1112,7 +1112,7 @@ public async Task HeaderParameterShouldAllowExample()
11121112 Type = JsonSchemaType . String ,
11131113 Format = "uuid"
11141114 } ,
1115- } , exampleHeader , " Parent" ) ;
1115+ } , exampleHeader , nameof ( JsonNode . Parent ) ) ;
11161116
11171117 var examplesHeader = result . Document . Components ? . Headers ? [ "examples-header" ] ;
11181118 Assert . NotNull ( examplesHeader ) ;
@@ -1144,7 +1144,7 @@ public async Task HeaderParameterShouldAllowExample()
11441144 Type = JsonSchemaType . String ,
11451145 Format = "uuid"
11461146 } ,
1147- } , examplesHeader , " Parent" ) ;
1147+ } , examplesHeader , nameof ( JsonNode . Parent ) ) ;
11481148 }
11491149
11501150 [ Fact ]
@@ -1424,7 +1424,7 @@ public async Task ParseDocWithRefsUsingProxyReferencesSucceeds()
14241424 var actualParamReference = Assert . IsType < OpenApiParameterReference > ( actualParam ) ;
14251425
14261426 // Assert
1427- OpenApiTestAssert . Equivalent ( expectedParamReference , actualParamReference , " Reference" , " Target" , " RecursiveTarget" , " Parent" , " Options" ) ;
1427+ OpenApiTestAssert . Equivalent ( expectedParamReference , actualParamReference , nameof ( OpenApiParameterReference . Reference ) , nameof ( OpenApiParameterReference . Target ) , nameof ( OpenApiParameterReference . RecursiveTarget ) , nameof ( JsonNode . Parent ) , nameof ( JsonNode . Options ) ) ;
14281428 Assert . Equal ( expectedSerializedDoc . MakeLineBreaksEnvironmentNeutral ( ) , outputDoc ) ;
14291429 }
14301430
@@ -1475,7 +1475,7 @@ public void ParseBasicDocumentWithServerVariableShouldSucceed()
14751475 Format = OpenApiConstants . Yaml
14761476 } , result . Diagnostic ) ;
14771477
1478- OpenApiTestAssert . Equivalent ( expected , result . Document , " BaseUri" ) ;
1478+ OpenApiTestAssert . Equivalent ( expected , result . Document , nameof ( OpenApiDocument . BaseUri ) ) ;
14791479 }
14801480
14811481 [ Fact ]
0 commit comments