@@ -449,7 +449,7 @@ public async Task Resource_types_are_documented()
449
449
}
450
450
451
451
[ Fact ]
452
- public async Task Resource_attributes_are_documented ( )
452
+ public async Task Attributes_are_documented ( )
453
453
{
454
454
// Act
455
455
JsonElement document = await _testContext . GetSwaggerDocumentAsync ( ) ;
@@ -465,9 +465,60 @@ public async Task Resource_attributes_are_documented()
465
465
schemasElement . Should ( ) . HaveProperty ( "skyscraperAttributesInPostRequest.properties.heightInMeters.description" , "The height of this building, in meters." ) ;
466
466
schemasElement . Should ( ) . HaveProperty ( "skyscraperAttributesInResponse.properties.heightInMeters.description" , "The height of this building, in meters." ) ;
467
467
468
- schemasElement . Should ( ) . HaveProperty ( "spaceAttributesInPatchRequest.properties.floorNumber.description" , "The floor number on which this space resides." ) ;
469
- schemasElement . Should ( ) . HaveProperty ( "spaceAttributesInPostRequest.properties.floorNumber.description" , "The floor number on which this space resides." ) ;
470
- schemasElement . Should ( ) . HaveProperty ( "spaceAttributesInResponse.properties.floorNumber.description" , "The floor number on which this space resides." ) ;
468
+ schemasElement . Should ( ) . ContainPath ( "spaceAttributesInPatchRequest.properties" ) . With ( propertiesElement =>
469
+ {
470
+ propertiesElement . Should ( ) . HaveProperty ( "floorNumber.description" , "The floor number on which this space resides." ) ;
471
+ propertiesElement . Should ( ) . HaveProperty ( "kind.description" , "The kind of this space." ) ;
472
+ } ) ;
473
+
474
+ schemasElement . Should ( ) . ContainPath ( "spaceAttributesInPostRequest.properties" ) . With ( propertiesElement =>
475
+ {
476
+ propertiesElement . Should ( ) . HaveProperty ( "floorNumber.description" , "The floor number on which this space resides." ) ;
477
+ propertiesElement . Should ( ) . HaveProperty ( "kind.description" , "The kind of this space." ) ;
478
+ } ) ;
479
+
480
+ schemasElement . Should ( ) . ContainPath ( "spaceAttributesInResponse.properties" ) . With ( propertiesElement =>
481
+ {
482
+ propertiesElement . Should ( ) . HaveProperty ( "floorNumber.description" , "The floor number on which this space resides." ) ;
483
+ propertiesElement . Should ( ) . HaveProperty ( "kind.description" , "The kind of this space." ) ;
484
+ } ) ;
485
+ } ) ;
486
+ }
487
+
488
+ [ Fact ]
489
+ public async Task Relationships_are_documented ( )
490
+ {
491
+ // Act
492
+ JsonElement document = await _testContext . GetSwaggerDocumentAsync ( ) ;
493
+
494
+ // Assert
495
+ document . Should ( ) . ContainPath ( "components.schemas" ) . With ( schemasElement =>
496
+ {
497
+ schemasElement . Should ( ) . HaveProperty ( "elevatorRelationshipsInPatchRequest.properties.existsIn.description" , "The skyscraper this elevator exists in." ) ;
498
+ schemasElement . Should ( ) . HaveProperty ( "elevatorRelationshipsInPostRequest.properties.existsIn.description" , "The skyscraper this elevator exists in." ) ;
499
+ schemasElement . Should ( ) . HaveProperty ( "elevatorRelationshipsInResponse.properties.existsIn.description" , "The skyscraper this elevator exists in." ) ;
500
+
501
+ schemasElement . Should ( ) . ContainPath ( "skyscraperRelationshipsInPatchRequest.properties" ) . With ( propertiesElement =>
502
+ {
503
+ propertiesElement . Should ( ) . HaveProperty ( "elevator.description" , "An optional elevator within this building, providing access to spaces." ) ;
504
+ propertiesElement . Should ( ) . HaveProperty ( "spaces.description" , "The spaces within this building." ) ;
505
+ } ) ;
506
+
507
+ schemasElement . Should ( ) . ContainPath ( "skyscraperRelationshipsInPostRequest.properties" ) . With ( propertiesElement =>
508
+ {
509
+ propertiesElement . Should ( ) . HaveProperty ( "elevator.description" , "An optional elevator within this building, providing access to spaces." ) ;
510
+ propertiesElement . Should ( ) . HaveProperty ( "spaces.description" , "The spaces within this building." ) ;
511
+ } ) ;
512
+
513
+ schemasElement . Should ( ) . ContainPath ( "skyscraperRelationshipsInResponse.properties" ) . With ( propertiesElement =>
514
+ {
515
+ propertiesElement . Should ( ) . HaveProperty ( "elevator.description" , "An optional elevator within this building, providing access to spaces." ) ;
516
+ propertiesElement . Should ( ) . HaveProperty ( "spaces.description" , "The spaces within this building." ) ;
517
+ } ) ;
518
+
519
+ schemasElement . Should ( ) . HaveProperty ( "spaceRelationshipsInPatchRequest.properties.existsIn.description" , "The skyscraper this space exists in." ) ;
520
+ schemasElement . Should ( ) . HaveProperty ( "spaceRelationshipsInPostRequest.properties.existsIn.description" , "The skyscraper this space exists in." ) ;
521
+ schemasElement . Should ( ) . HaveProperty ( "spaceRelationshipsInResponse.properties.existsIn.description" , "The skyscraper this space exists in." ) ;
471
522
} ) ;
472
523
}
473
524
0 commit comments