@@ -93,10 +93,11 @@ public async Task Include_from_resource_definition_is_added()
9393 var hitCounter = _testContext . Factory . Services . GetRequiredService < ResourceDefinitionHitCounter > ( ) ;
9494
9595 var settingsProvider = ( TestClientSettingsProvider ) _testContext . Factory . Services . GetRequiredService < IClientSettingsProvider > ( ) ;
96- settingsProvider . AutoIncludeOrbitingPlanetForMoons ( ) ;
96+ settingsProvider . AutoIncludeStarGivingLightToMoon ( ) ;
9797
9898 Moon moon = _fakers . Moon . Generate ( ) ;
9999 moon . OrbitsAround = _fakers . Planet . Generate ( ) ;
100+ moon . IsGivenLightBy = _fakers . Star . Generate ( ) ;
100101
101102 await _testContext . RunOnDatabaseAsync ( async dbContext =>
102103 {
@@ -114,18 +115,18 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
114115
115116 responseDocument . Data . SingleValue . ShouldNotBeNull ( ) ;
116117
117- responseDocument . Data . SingleValue . Relationships . ShouldContainKey ( "orbitsAround " ) . With ( value =>
118+ responseDocument . Data . SingleValue . Relationships . ShouldContainKey ( "isGivenLightBy " ) . With ( value =>
118119 {
119120 value . ShouldNotBeNull ( ) ;
120121 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 ) ;
123124 } ) ;
124125
125126 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 ) ) ;
129130
130131 hitCounter . HitExtensibilityPoints . Should ( ) . BeEquivalentTo ( new [ ]
131132 {
@@ -134,12 +135,12 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
134135 ( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . OnApplySort ) ,
135136 ( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
136137 ( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . OnApplyIncludes ) ,
137- ( typeof ( Planet ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
138- ( typeof ( Planet ) , ResourceDefinitionExtensibilityPoints . OnApplyIncludes ) ,
138+ ( typeof ( Star ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
139+ ( typeof ( Star ) , ResourceDefinitionExtensibilityPoints . OnApplyIncludes ) ,
139140 ( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
140141 ( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . GetMeta ) ,
141- ( typeof ( Planet ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
142- ( typeof ( Planet ) , ResourceDefinitionExtensibilityPoints . GetMeta )
142+ ( typeof ( Star ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
143+ ( typeof ( Star ) , ResourceDefinitionExtensibilityPoints . GetMeta )
143144 } , options => options . WithStrictOrdering ( ) ) ;
144145 }
145146
@@ -150,11 +151,11 @@ public async Task Include_from_included_resource_definition_is_added()
150151 var hitCounter = _testContext . Factory . Services . GetRequiredService < ResourceDefinitionHitCounter > ( ) ;
151152
152153 var settingsProvider = ( TestClientSettingsProvider ) _testContext . Factory . Services . GetRequiredService < IClientSettingsProvider > ( ) ;
153- settingsProvider . AutoIncludeOrbitingPlanetForMoons ( ) ;
154+ settingsProvider . AutoIncludeStarGivingLightToMoon ( ) ;
154155
155156 Planet planet = _fakers . Planet . Generate ( ) ;
156157 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 ( ) ;
158159
159160 await _testContext . RunOnDatabaseAsync ( async dbContext =>
160161 {
@@ -178,11 +179,9 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
178179 responseDocument . Included [ 0 ] . Id . Should ( ) . Be ( planet . Moons . ElementAt ( 0 ) . StringId ) ;
179180 responseDocument . Included [ 0 ] . Attributes . ShouldContainKey ( "name" ) . With ( value => value . Should ( ) . Be ( planet . Moons . ElementAt ( 0 ) . Name ) ) ;
180181
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 ) ) ;
186185
187186 hitCounter . HitExtensibilityPoints . Should ( ) . BeEquivalentTo ( new [ ]
188187 {
@@ -196,11 +195,14 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
196195 ( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . OnApplyPagination ) ,
197196 ( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
198197 ( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . OnApplyIncludes ) ,
199- ( typeof ( Planet ) , ResourceDefinitionExtensibilityPoints . OnApplyIncludes ) ,
198+ ( typeof ( Star ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
199+ ( typeof ( Star ) , ResourceDefinitionExtensibilityPoints . OnApplyIncludes ) ,
200200 ( typeof ( Planet ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
201201 ( typeof ( Planet ) , ResourceDefinitionExtensibilityPoints . GetMeta ) ,
202202 ( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
203- ( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . GetMeta )
203+ ( typeof ( Moon ) , ResourceDefinitionExtensibilityPoints . GetMeta ) ,
204+ ( typeof ( Star ) , ResourceDefinitionExtensibilityPoints . OnApplySparseFieldSet ) ,
205+ ( typeof ( Star ) , ResourceDefinitionExtensibilityPoints . GetMeta )
204206 } , options => options . WithStrictOrdering ( ) ) ;
205207 }
206208
0 commit comments