@@ -93,10 +93,11 @@ public async Task Include_from_resource_definition_is_added()
93
93
var hitCounter = _testContext . Factory . Services . GetRequiredService < ResourceDefinitionHitCounter > ( ) ;
94
94
95
95
var settingsProvider = ( TestClientSettingsProvider ) _testContext . Factory . Services . GetRequiredService < IClientSettingsProvider > ( ) ;
96
- settingsProvider . AutoIncludeOrbitingPlanetForMoons ( ) ;
96
+ settingsProvider . AutoIncludeStarGivingLightToMoon ( ) ;
97
97
98
98
Moon moon = _fakers . Moon . Generate ( ) ;
99
99
moon . OrbitsAround = _fakers . Planet . Generate ( ) ;
100
+ moon . IsGivenLightBy = _fakers . Star . Generate ( ) ;
100
101
101
102
await _testContext . RunOnDatabaseAsync ( async dbContext =>
102
103
{
@@ -114,18 +115,18 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
114
115
115
116
responseDocument . Data . SingleValue . ShouldNotBeNull ( ) ;
116
117
117
- responseDocument . Data . SingleValue . Relationships . ShouldContainKey ( "orbitsAround " ) . With ( value =>
118
+ responseDocument . Data . SingleValue . Relationships . ShouldContainKey ( "isGivenLightBy " ) . With ( value =>
118
119
{
119
120
value . ShouldNotBeNull ( ) ;
120
121
value . Data . SingleValue . ShouldNotBeNull ( ) ;
121
- value . Data . SingleValue . Type . Should ( ) . Be ( "planets " ) ;
122
- value . Data . SingleValue . Id . Should ( ) . Be ( moon . OrbitsAround . StringId ) ;
122
+ value . Data . SingleValue . Type . Should ( ) . Be ( "stars " ) ;
123
+ value . Data . SingleValue . Id . Should ( ) . Be ( moon . IsGivenLightBy . StringId ) ;
123
124
} ) ;
124
125
125
126
responseDocument . Included . ShouldHaveCount ( 1 ) ;
126
- responseDocument . Included [ 0 ] . Type . Should ( ) . Be ( "planets " ) ;
127
- responseDocument . Included [ 0 ] . Id . Should ( ) . Be ( moon . OrbitsAround . StringId ) ;
128
- responseDocument . Included [ 0 ] . Attributes . ShouldContainKey ( "publicName " ) . With ( value => value . Should ( ) . Be ( moon . OrbitsAround . PublicName ) ) ;
127
+ responseDocument . Included [ 0 ] . Type . Should ( ) . Be ( "stars " ) ;
128
+ responseDocument . Included [ 0 ] . Id . Should ( ) . Be ( moon . IsGivenLightBy . StringId ) ;
129
+ responseDocument . Included [ 0 ] . Attributes . ShouldContainKey ( "name " ) . With ( value => value . Should ( ) . Be ( moon . IsGivenLightBy . Name ) ) ;
129
130
130
131
hitCounter . HitExtensibilityPoints . Should ( ) . BeEquivalentTo ( new [ ]
131
132
{
@@ -134,12 +135,12 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
134
135
( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . OnApplySort ) ,
135
136
( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
136
137
( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . OnApplyIncludes ) ,
137
- ( typeof ( Planet ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
138
- ( typeof ( Planet ) , ResourceDefinitionExtensibilityPoints . OnApplyIncludes ) ,
138
+ ( typeof ( Star ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
139
+ ( typeof ( Star ) , ResourceDefinitionExtensibilityPoints . OnApplyIncludes ) ,
139
140
( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
140
141
( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . GetMeta ) ,
141
- ( typeof ( Planet ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
142
- ( typeof ( Planet ) , ResourceDefinitionExtensibilityPoints . GetMeta )
142
+ ( typeof ( Star ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
143
+ ( typeof ( Star ) , ResourceDefinitionExtensibilityPoints . GetMeta )
143
144
} , options => options . WithStrictOrdering ( ) ) ;
144
145
}
145
146
@@ -150,11 +151,11 @@ public async Task Include_from_included_resource_definition_is_added()
150
151
var hitCounter = _testContext . Factory . Services . GetRequiredService < ResourceDefinitionHitCounter > ( ) ;
151
152
152
153
var settingsProvider = ( TestClientSettingsProvider ) _testContext . Factory . Services . GetRequiredService < IClientSettingsProvider > ( ) ;
153
- settingsProvider . AutoIncludeOrbitingPlanetForMoons ( ) ;
154
+ settingsProvider . AutoIncludeStarGivingLightToMoon ( ) ;
154
155
155
156
Planet planet = _fakers . Planet . Generate ( ) ;
156
157
planet . Moons = _fakers . Moon . Generate ( 1 ) . ToHashSet ( ) ;
157
- planet . Moons . ElementAt ( 0 ) . OrbitsAround = _fakers . Planet . Generate ( ) ;
158
+ planet . Moons . ElementAt ( 0 ) . IsGivenLightBy = _fakers . Star . Generate ( ) ;
158
159
159
160
await _testContext . RunOnDatabaseAsync ( async dbContext =>
160
161
{
@@ -178,11 +179,9 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
178
179
responseDocument . Included [ 0 ] . Id . Should ( ) . Be ( planet . Moons . ElementAt ( 0 ) . StringId ) ;
179
180
responseDocument . Included [ 0 ] . Attributes . ShouldContainKey ( "name" ) . With ( value => value . Should ( ) . Be ( planet . Moons . ElementAt ( 0 ) . Name ) ) ;
180
181
181
- string moonName = planet . Moons . ElementAt ( 0 ) . OrbitsAround . PublicName ;
182
-
183
- responseDocument . Included [ 1 ] . Type . Should ( ) . Be ( "planets" ) ;
184
- responseDocument . Included [ 1 ] . Id . Should ( ) . Be ( planet . Moons . ElementAt ( 0 ) . OrbitsAround . StringId ) ;
185
- responseDocument . Included [ 1 ] . Attributes . ShouldContainKey ( "publicName" ) . With ( value => value . Should ( ) . Be ( moonName ) ) ;
182
+ responseDocument . Included [ 1 ] . Type . Should ( ) . Be ( "stars" ) ;
183
+ responseDocument . Included [ 1 ] . Id . Should ( ) . Be ( planet . Moons . ElementAt ( 0 ) . IsGivenLightBy ! . StringId ) ;
184
+ responseDocument . Included [ 1 ] . Attributes . ShouldContainKey ( "name" ) . With ( value => value . Should ( ) . Be ( planet . Moons . ElementAt ( 0 ) . IsGivenLightBy ! . Name ) ) ;
186
185
187
186
hitCounter . HitExtensibilityPoints . Should ( ) . BeEquivalentTo ( new [ ]
188
187
{
@@ -196,11 +195,14 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
196
195
( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . OnApplyPagination ) ,
197
196
( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
198
197
( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . OnApplyIncludes ) ,
199
- ( typeof ( Planet ) , ResourceDefinitionExtensibilityPoints . OnApplyIncludes ) ,
198
+ ( typeof ( Star ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
199
+ ( typeof ( Star ) , ResourceDefinitionExtensibilityPoints . OnApplyIncludes ) ,
200
200
( typeof ( Planet ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
201
201
( typeof ( Planet ) , ResourceDefinitionExtensibilityPoints . GetMeta ) ,
202
202
( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
203
- ( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . GetMeta )
203
+ ( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . GetMeta ) ,
204
+ ( typeof ( Star ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
205
+ ( typeof ( Star ) , ResourceDefinitionExtensibilityPoints . GetMeta )
204
206
} , options => options . WithStrictOrdering ( ) ) ;
205
207
}
206
208
0 commit comments