@@ -112,7 +112,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
112
112
resource . Attributes . ShouldContainKey ( "gearCount" ) . With ( value => value . Should ( ) . Be ( tandem . GearCount ) ) ;
113
113
resource . Attributes . ShouldContainKey ( "passengerCount" ) . With ( value => value . Should ( ) . Be ( tandem . PassengerCount ) ) ;
114
114
115
- resource . Relationships . ShouldOnlyContainKeys ( "manufacturer" , "wheels" , "cargoBox" , "lights" , "features" ) ;
115
+ resource . Relationships . ShouldOnlyContainKeys ( "manufacturer" , "wheels" , "cargoBox" , "lights" , "foldingDimensions" , " features") ;
116
116
117
117
foreach ( ( string name , RelationshipObject ? value ) in resource . Relationships )
118
118
{
@@ -235,7 +235,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
235
235
resource . Attributes . ShouldContainKey ( "gearCount" ) . With ( value => value . Should ( ) . Be ( tandem . GearCount ) ) ;
236
236
resource . Attributes . ShouldContainKey ( "passengerCount" ) . With ( value => value . Should ( ) . Be ( tandem . PassengerCount ) ) ;
237
237
238
- resource . Relationships . ShouldOnlyContainKeys ( "manufacturer" , "wheels" , "cargoBox" , "lights" , "features" ) ;
238
+ resource . Relationships . ShouldOnlyContainKeys ( "manufacturer" , "wheels" , "cargoBox" , "lights" , "foldingDimensions" , " features") ;
239
239
240
240
foreach ( ( string name , RelationshipObject ? value ) in resource . Relationships )
241
241
{
@@ -287,7 +287,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
287
287
resource . Attributes . ShouldContainKey ( "gearCount" ) . With ( value => value . Should ( ) . Be ( tandem . GearCount ) ) ;
288
288
resource . Attributes . ShouldContainKey ( "passengerCount" ) . With ( value => value . Should ( ) . Be ( tandem . PassengerCount ) ) ;
289
289
290
- resource . Relationships . ShouldOnlyContainKeys ( "manufacturer" , "wheels" , "cargoBox" , "lights" , "features" ) ;
290
+ resource . Relationships . ShouldOnlyContainKeys ( "manufacturer" , "wheels" , "cargoBox" , "lights" , "foldingDimensions" , " features") ;
291
291
292
292
foreach ( ( string name , RelationshipObject ? value ) in resource . Relationships )
293
293
{
@@ -323,7 +323,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
323
323
responseDocument . Data . SingleValue . Type . Should ( ) . Be ( "tandems" ) ;
324
324
responseDocument . Data . SingleValue . Id . Should ( ) . Be ( tandem . StringId ) ;
325
325
responseDocument . Data . SingleValue . Attributes . ShouldOnlyContainKeys ( "weight" , "requiresDriverLicense" , "gearCount" , "passengerCount" ) ;
326
- responseDocument . Data . SingleValue . Relationships . ShouldOnlyContainKeys ( "manufacturer" , "wheels" , "cargoBox" , "lights" , "features" ) ;
326
+ responseDocument . Data . SingleValue . Relationships . ShouldOnlyContainKeys ( "manufacturer" , "wheels" , "cargoBox" , "lights" , "foldingDimensions" , " features") ;
327
327
}
328
328
329
329
[ Fact ]
@@ -350,7 +350,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
350
350
responseDocument . Data . SingleValue . Type . Should ( ) . Be ( "tandems" ) ;
351
351
responseDocument . Data . SingleValue . Id . Should ( ) . Be ( tandem . StringId ) ;
352
352
responseDocument . Data . SingleValue . Attributes . ShouldOnlyContainKeys ( "weight" , "requiresDriverLicense" , "gearCount" , "passengerCount" ) ;
353
- responseDocument . Data . SingleValue . Relationships . ShouldOnlyContainKeys ( "manufacturer" , "wheels" , "cargoBox" , "lights" , "features" ) ;
353
+ responseDocument . Data . SingleValue . Relationships . ShouldOnlyContainKeys ( "manufacturer" , "wheels" , "cargoBox" , "lights" , "foldingDimensions" , " features") ;
354
354
}
355
355
356
356
[ Fact ]
@@ -377,7 +377,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
377
377
responseDocument . Data . SingleValue . Type . Should ( ) . Be ( "tandems" ) ;
378
378
responseDocument . Data . SingleValue . Id . Should ( ) . Be ( tandem . StringId ) ;
379
379
responseDocument . Data . SingleValue . Attributes . ShouldOnlyContainKeys ( "weight" , "requiresDriverLicense" , "gearCount" , "passengerCount" ) ;
380
- responseDocument . Data . SingleValue . Relationships . ShouldOnlyContainKeys ( "manufacturer" , "wheels" , "cargoBox" , "lights" , "features" ) ;
380
+ responseDocument . Data . SingleValue . Relationships . ShouldOnlyContainKeys ( "manufacturer" , "wheels" , "cargoBox" , "lights" , "foldingDimensions" , " features") ;
381
381
}
382
382
383
383
[ Fact ]
@@ -549,15 +549,15 @@ public async Task Cannot_get_secondary_resource_defined_in_derived_type_at_concr
549
549
{
550
550
// Arrange
551
551
Tandem tandem = _fakers . Tandem . GenerateOne ( ) ;
552
- tandem . Features = _fakers . GenericFeature . GenerateSet ( 1 ) ;
552
+ tandem . FoldingDimensions = _fakers . Box . GenerateOne ( ) ;
553
553
554
554
await _testContext . RunOnDatabaseAsync ( async dbContext =>
555
555
{
556
556
dbContext . Vehicles . Add ( tandem ) ;
557
557
await dbContext . SaveChangesAsync ( ) ;
558
558
} ) ;
559
559
560
- string route = $ "/bikes/{ tandem . StringId } /features ";
560
+ string route = $ "/bikes/{ tandem . StringId } /foldingDimensions ";
561
561
562
562
// Act
563
563
( HttpResponseMessage httpResponse , Document responseDocument ) = await _testContext . ExecuteGetAsync < Document > ( route ) ;
@@ -570,7 +570,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
570
570
ErrorObject error = responseDocument . Errors [ 0 ] ;
571
571
error . StatusCode . Should ( ) . Be ( HttpStatusCode . NotFound ) ;
572
572
error . Title . Should ( ) . Be ( "The requested relationship does not exist." ) ;
573
- error . Detail . Should ( ) . Be ( "Resource of type 'bikes' does not contain a relationship named 'features '." ) ;
573
+ error . Detail . Should ( ) . Be ( "Resource of type 'bikes' does not contain a relationship named 'foldingDimensions '." ) ;
574
574
error . Source . Should ( ) . BeNull ( ) ;
575
575
}
576
576
@@ -1244,7 +1244,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
1244
1244
{
1245
1245
resource . Id . Should ( ) . Be ( tandem . StringId ) ;
1246
1246
resource . Attributes . ShouldOnlyContainKeys ( "weight" , "requiresDriverLicense" , "gearCount" , "passengerCount" ) ;
1247
- resource . Relationships . ShouldOnlyContainKeys ( "manufacturer" , "wheels" , "lights" , "cargoBox" , "features" ) ;
1247
+ resource . Relationships . ShouldOnlyContainKeys ( "manufacturer" , "wheels" , "lights" , "cargoBox" , "foldingDimensions" , " features") ;
1248
1248
} ) ;
1249
1249
1250
1250
responseDocument . Data . ManyValue . Should ( ) . ContainSingle ( resource => resource . Type == "cars" ) . Subject . With ( resource =>
@@ -1547,6 +1547,12 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
1547
1547
"weight": {{ tandem . Weight . ToString ( CultureInfo . InvariantCulture ) }}
1548
1548
},
1549
1549
"relationships": {
1550
+ "foldingDimensions": {
1551
+ "links": {
1552
+ "self": "/tandems/{{ tandem . StringId }} /relationships/foldingDimensions",
1553
+ "related": "/tandems/{{ tandem . StringId }} /foldingDimensions"
1554
+ }
1555
+ },
1550
1556
"features": {
1551
1557
"links": {
1552
1558
"self": "/tandems/{{ tandem . StringId }} /relationships/features",
0 commit comments