@@ -136,6 +136,7 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
136
136
} , serviceCollection =>
137
137
{
138
138
serviceCollection . RegisterCollectionRuleAction < PassThroughActionFactory , PassThroughOptions , PassThroughActionDescriptor > ( ) ;
139
+ TestValidatableTypes . AddValidation ( serviceCollection ) ;
139
140
} ) ;
140
141
}
141
142
@@ -157,6 +158,7 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
157
158
CollectionRuleOptions ruleOptions = host . Services . GetRequiredService < IOptionsMonitor < CollectionRuleOptions > > ( ) . Get ( DefaultRuleName ) ;
158
159
ILogger < CollectionRuleService > logger = host . Services . GetRequiredService < ILogger < CollectionRuleService > > ( ) ;
159
160
TimeProvider timeProvider = host . Services . GetRequiredService < TimeProvider > ( ) ;
161
+ ICollectionRuleActionOperations actionOperations = host . Services . GetRequiredService < ICollectionRuleActionOperations > ( ) ;
160
162
161
163
const string processName = "actionProcess" ;
162
164
const int processId = 123 ;
@@ -165,7 +167,7 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
165
167
Guid instanceId = Guid . NewGuid ( ) ;
166
168
CollectionRuleContext context = new ( DefaultRuleName , ruleOptions , new TestProcessInfo ( instanceId , processId : processId , commandLine : commandLine ) , HostInfo . GetCurrent ( timeProvider ) , logger ) ;
167
169
168
- ActionOptionsDependencyAnalyzer analyzer = ActionOptionsDependencyAnalyzer . Create ( context ) ;
170
+ ActionOptionsDependencyAnalyzer analyzer = ActionOptionsDependencyAnalyzer . Create ( context , actionOperations ) ;
169
171
PassThroughOptions newSettings = ( PassThroughOptions ) analyzer . SubstituteOptionValues ( new Dictionary < string , CollectionRuleActionResult > ( ) , 1 , actionOptions ) ;
170
172
171
173
Assert . Equal ( processName , newSettings . Input1 ) ;
@@ -175,6 +177,7 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
175
177
} , serviceCollection =>
176
178
{
177
179
serviceCollection . RegisterCollectionRuleAction < PassThroughActionFactory , PassThroughOptions , PassThroughActionDescriptor > ( ) ;
180
+ TestValidatableTypes . AddValidation ( serviceCollection ) ;
178
181
} ) ;
179
182
}
180
183
@@ -196,13 +199,14 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
196
199
CollectionRuleOptions ruleOptions = host . Services . GetRequiredService < IOptionsMonitor < CollectionRuleOptions > > ( ) . Get ( DefaultRuleName ) ;
197
200
ILogger < CollectionRuleService > logger = host . Services . GetRequiredService < ILogger < CollectionRuleService > > ( ) ;
198
201
MockTimeProvider timeProvider = host . Services . GetRequiredService < TimeProvider > ( ) as MockTimeProvider ;
202
+ ICollectionRuleActionOperations actionOperations = host . Services . GetRequiredService < ICollectionRuleActionOperations > ( ) ;
199
203
200
204
const string hostName = "exampleHost" ;
201
205
Guid instanceId = Guid . NewGuid ( ) ;
202
206
HostInfo hostInfo = new HostInfo ( hostName , timeProvider ) ;
203
207
CollectionRuleContext context = new ( DefaultRuleName , ruleOptions , new TestProcessInfo ( instanceId ) , hostInfo , logger ) ;
204
208
205
- ActionOptionsDependencyAnalyzer analyzer = ActionOptionsDependencyAnalyzer . Create ( context ) ;
209
+ ActionOptionsDependencyAnalyzer analyzer = ActionOptionsDependencyAnalyzer . Create ( context , actionOperations ) ;
206
210
PassThroughOptions newSettings = ( PassThroughOptions ) analyzer . SubstituteOptionValues ( new Dictionary < string , CollectionRuleActionResult > ( ) , 1 , actionOptions ) ;
207
211
208
212
Assert . Equal ( hostName , newSettings . Input1 ) ;
@@ -212,6 +216,7 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
212
216
{
213
217
serviceCollection . AddSingleton < TimeProvider , MockTimeProvider > ( ) ;
214
218
serviceCollection . RegisterCollectionRuleAction < PassThroughActionFactory , PassThroughOptions , PassThroughActionDescriptor > ( ) ;
219
+ TestValidatableTypes . AddValidation ( serviceCollection ) ;
215
220
} ) ;
216
221
}
217
222
@@ -239,11 +244,12 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
239
244
CollectionRuleOptions ruleOptions = host . Services . GetRequiredService < IOptionsMonitor < CollectionRuleOptions > > ( ) . Get ( DefaultRuleName ) ;
240
245
ILogger < CollectionRuleService > logger = host . Services . GetRequiredService < ILogger < CollectionRuleService > > ( ) ;
241
246
TimeProvider timeProvider = host . Services . GetRequiredService < TimeProvider > ( ) ;
247
+ ICollectionRuleActionOperations actionOperations = host . Services . GetRequiredService < ICollectionRuleActionOperations > ( ) ;
242
248
243
249
Guid instanceId = Guid . NewGuid ( ) ;
244
250
CollectionRuleContext context = new ( DefaultRuleName , ruleOptions , new TestProcessInfo ( instanceId ) , HostInfo . GetCurrent ( timeProvider ) , logger ) ;
245
251
246
- ActionOptionsDependencyAnalyzer analyzer = ActionOptionsDependencyAnalyzer . Create ( context ) ;
252
+ ActionOptionsDependencyAnalyzer analyzer = ActionOptionsDependencyAnalyzer . Create ( context , actionOperations ) ;
247
253
analyzer . GetActionDependencies ( 1 ) ;
248
254
analyzer . SubstituteOptionValues ( new Dictionary < string , CollectionRuleActionResult > ( ) , 1 , actionOptions ) ;
249
255
@@ -255,6 +261,7 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
255
261
} , serviceCollection =>
256
262
{
257
263
serviceCollection . RegisterCollectionRuleAction < PassThroughActionFactory , PassThroughOptions , PassThroughActionDescriptor > ( ) ;
264
+ TestValidatableTypes . AddValidation ( serviceCollection ) ;
258
265
} , loggingBuilder =>
259
266
{
260
267
loggingBuilder . AddProvider ( new TestLoggerProvider ( record ) ) ;
@@ -279,18 +286,20 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
279
286
CollectionRuleOptions ruleOptions = host . Services . GetRequiredService < IOptionsMonitor < CollectionRuleOptions > > ( ) . Get ( DefaultRuleName ) ;
280
287
ILogger < CollectionRuleService > logger = host . Services . GetRequiredService < ILogger < CollectionRuleService > > ( ) ;
281
288
TimeProvider timeProvider = host . Services . GetRequiredService < TimeProvider > ( ) ;
289
+ ICollectionRuleActionOperations actionOperations = host . Services . GetRequiredService < ICollectionRuleActionOperations > ( ) ;
282
290
283
291
Guid instanceId = Guid . NewGuid ( ) ;
284
292
CollectionRuleContext context = new ( DefaultRuleName , ruleOptions , new TestProcessInfo ( instanceId ) , HostInfo . GetCurrent ( timeProvider ) , logger ) ;
285
293
286
- ActionOptionsDependencyAnalyzer analyzer = ActionOptionsDependencyAnalyzer . Create ( context ) ;
294
+ ActionOptionsDependencyAnalyzer analyzer = ActionOptionsDependencyAnalyzer . Create ( context , actionOperations ) ;
287
295
PassThroughOptions newSettings = ( PassThroughOptions ) analyzer . SubstituteOptionValues ( new Dictionary < string , CollectionRuleActionResult > ( ) , 1 , actionOptions ) ;
288
296
289
297
Assert . Equal ( instanceId . ToString ( "D" ) , newSettings . Input1 ) ;
290
298
291
299
} , serviceCollection =>
292
300
{
293
301
serviceCollection . RegisterCollectionRuleAction < PassThroughActionFactory , PassThroughOptions , PassThroughActionDescriptor > ( ) ;
302
+ TestValidatableTypes . AddValidation ( serviceCollection ) ;
294
303
} ) ;
295
304
}
296
305
@@ -353,6 +362,7 @@ await TestHostHelper.CreateCollectionRulesHost(_outputHelper, rootOptions =>
353
362
} , serviceCollection =>
354
363
{
355
364
serviceCollection . RegisterCollectionRuleAction < PassThroughActionFactory , PassThroughOptions , PassThroughActionDescriptor > ( ) ;
365
+ TestValidatableTypes . AddValidation ( serviceCollection ) ;
356
366
} ) ;
357
367
}
358
368
}
0 commit comments