@@ -184,9 +184,10 @@ public async Task ProcessAsync_GeneratesExpectedOutput(
184
184
var metadata = metadataProvider . GetMetadataForProperty ( modelAccessor , containerType , propertyName : "Text" ) ;
185
185
var modelExpression = new ModelExpression ( nameAndId . Name , metadata ) ;
186
186
187
- var context = new TagHelperContext ( allAttributes : new Dictionary < string , object > ( ) ,
188
- uniqueId : "test" ,
189
- getChildContentAsync : ( ) => Task . FromResult ( "Something" ) ) ;
187
+ var tagHelperContext = new TagHelperContext (
188
+ allAttributes : new Dictionary < string , object > ( ) ,
189
+ uniqueId : "test" ,
190
+ getChildContentAsync : ( ) => Task . FromResult ( "Something" ) ) ;
190
191
var output = new TagHelperOutput ( expectedTagName , originalAttributes )
191
192
{
192
193
PreContent = expectedPreContent ,
@@ -211,7 +212,7 @@ public async Task ProcessAsync_GeneratesExpectedOutput(
211
212
} ;
212
213
213
214
// Act
214
- await tagHelper . ProcessAsync ( context , output ) ;
215
+ await tagHelper . ProcessAsync ( tagHelperContext , output ) ;
215
216
216
217
// Assert
217
218
Assert . Equal ( expectedAttributes , output . Attributes ) ;
@@ -263,9 +264,10 @@ public async Task ProcessAsync_GeneratesExpectedOutput_WithItems(
263
264
var metadata = metadataProvider . GetMetadataForProperty ( modelAccessor , containerType , propertyName : "Text" ) ;
264
265
var modelExpression = new ModelExpression ( nameAndId . Name , metadata ) ;
265
266
266
- var context = new TagHelperContext ( allAttributes : new Dictionary < string , object > ( ) ,
267
- uniqueId : "test" ,
268
- getChildContentAsync : ( ) => Task . FromResult ( "Something" ) ) ;
267
+ var tagHelperContext = new TagHelperContext (
268
+ allAttributes : new Dictionary < string , object > ( ) ,
269
+ uniqueId : "test" ,
270
+ getChildContentAsync : ( ) => Task . FromResult ( "Something" ) ) ;
269
271
var output = new TagHelperOutput ( expectedTagName , originalAttributes )
270
272
{
271
273
PreContent = expectedPreContent ,
@@ -292,7 +294,7 @@ public async Task ProcessAsync_GeneratesExpectedOutput_WithItems(
292
294
} ;
293
295
294
296
// Act
295
- await tagHelper . ProcessAsync ( context , output ) ;
297
+ await tagHelper . ProcessAsync ( tagHelperContext , output ) ;
296
298
297
299
// Assert
298
300
Assert . Equal ( expectedAttributes , output . Attributes ) ;
@@ -329,9 +331,10 @@ public async Task ProcessAsync_CallsGeneratorWithExpectedValues_ItemsAndMultiple
329
331
var propertyName = "Property1" ;
330
332
var expectedTagName = "select" ;
331
333
332
- var context = new TagHelperContext ( contextAttributes ,
333
- uniqueId : "test" ,
334
- getChildContentAsync : ( ) => Task . FromResult ( "Something" ) ) ;
334
+ var tagHelperContext = new TagHelperContext (
335
+ contextAttributes ,
336
+ uniqueId : "test" ,
337
+ getChildContentAsync : ( ) => Task . FromResult ( "Something" ) ) ;
335
338
var output = new TagHelperOutput ( expectedTagName , originalAttributes ) ;
336
339
337
340
// TODO: https://github.com/aspnet/Mvc/issues/1253
@@ -369,7 +372,7 @@ public async Task ProcessAsync_CallsGeneratorWithExpectedValues_ItemsAndMultiple
369
372
} ;
370
373
371
374
// Act
372
- await tagHelper . ProcessAsync ( context , output ) ;
375
+ await tagHelper . ProcessAsync ( tagHelperContext , output ) ;
373
376
374
377
// Assert
375
378
htmlGenerator . Verify ( ) ;
@@ -394,9 +397,10 @@ public async Task TagHelper_CallsGeneratorWithExpectedValues_RealModelType(
394
397
var propertyName = "Property1" ;
395
398
var tagName = "select" ;
396
399
397
- var context = new TagHelperContext ( contextAttributes ,
398
- uniqueId : "test" ,
399
- getChildContentAsync : ( ) => Task . FromResult ( "Something" ) ) ;
400
+ var tagHelperContext = new TagHelperContext (
401
+ contextAttributes ,
402
+ uniqueId : "test" ,
403
+ getChildContentAsync : ( ) => Task . FromResult ( "Something" ) ) ;
400
404
var output = new TagHelperOutput ( tagName , originalAttributes ) ;
401
405
402
406
var metadataProvider = new EmptyModelMetadataProvider ( ) ;
@@ -427,7 +431,7 @@ public async Task TagHelper_CallsGeneratorWithExpectedValues_RealModelType(
427
431
} ;
428
432
429
433
// Act
430
- await tagHelper . ProcessAsync ( context , output ) ;
434
+ await tagHelper . ProcessAsync ( tagHelperContext , output ) ;
431
435
432
436
// Assert
433
437
htmlGenerator . Verify ( ) ;
@@ -462,9 +466,10 @@ public async Task ProcessAsync_RestoresMultiple_IfForNotBound(string attributeNa
462
466
var expectedPostContent = "original post-content" ;
463
467
var expectedTagName = "select" ;
464
468
465
- var context = new TagHelperContext ( contextAttributes ,
466
- uniqueId : "test" ,
467
- getChildContentAsync : ( ) => Task . FromResult ( "Something" ) ) ;
469
+ var tagHelperContext = new TagHelperContext (
470
+ contextAttributes ,
471
+ uniqueId : "test" ,
472
+ getChildContentAsync : ( ) => Task . FromResult ( "Something" ) ) ;
468
473
var output = new TagHelperOutput ( expectedTagName , originalAttributes )
469
474
{
470
475
PreContent = expectedPreContent ,
@@ -479,7 +484,7 @@ public async Task ProcessAsync_RestoresMultiple_IfForNotBound(string attributeNa
479
484
} ;
480
485
481
486
// Act
482
- await tagHelper . ProcessAsync ( context , output ) ;
487
+ await tagHelper . ProcessAsync ( tagHelperContext , output ) ;
483
488
484
489
// Assert
485
490
Assert . Equal ( expectedAttributes , output . Attributes ) ;
@@ -499,9 +504,10 @@ public async Task ProcessAsync_Throws_IfForNotBoundButItemsIs()
499
504
var expectedTagName = "select" ;
500
505
var expectedMessage = "Cannot determine body for <select>. 'asp-items' must be null if 'asp-for' is null." ;
501
506
502
- var context = new TagHelperContext ( contextAttributes ,
503
- uniqueId : "test" ,
504
- getChildContentAsync : ( ) => Task . FromResult ( "Something" ) ) ;
507
+ var tagHelperContext = new TagHelperContext (
508
+ contextAttributes ,
509
+ uniqueId : "test" ,
510
+ getChildContentAsync : ( ) => Task . FromResult ( "Something" ) ) ;
505
511
var output = new TagHelperOutput ( expectedTagName , originalAttributes ) ;
506
512
var tagHelper = new SelectTagHelper
507
513
{
@@ -510,7 +516,7 @@ public async Task ProcessAsync_Throws_IfForNotBoundButItemsIs()
510
516
511
517
// Act & Assert
512
518
var exception = await Assert . ThrowsAsync < InvalidOperationException > (
513
- ( ) => tagHelper . ProcessAsync ( context , output ) ) ;
519
+ ( ) => tagHelper . ProcessAsync ( tagHelperContext , output ) ) ;
514
520
Assert . Equal ( expectedMessage , exception . Message ) ;
515
521
}
516
522
@@ -531,9 +537,10 @@ public async Task ProcessAsync_Throws_IfMultipleInvalid(string multiple)
531
537
var expectedMessage = "Cannot parse 'multiple' value '" + multiple +
532
538
"' for <select>. Acceptable values are 'false', 'true' and 'multiple'." ;
533
539
534
- var context = new TagHelperContext ( contextAttributes ,
535
- uniqueId : "test" ,
536
- getChildContentAsync : ( ) => Task . FromResult ( "Something" ) ) ;
540
+ var tagHelperContext = new TagHelperContext (
541
+ contextAttributes ,
542
+ uniqueId : "test" ,
543
+ getChildContentAsync : ( ) => Task . FromResult ( "Something" ) ) ;
537
544
var output = new TagHelperOutput ( expectedTagName , originalAttributes ) ;
538
545
539
546
var metadataProvider = new EmptyModelMetadataProvider ( ) ;
@@ -549,7 +556,7 @@ public async Task ProcessAsync_Throws_IfMultipleInvalid(string multiple)
549
556
550
557
// Act & Assert
551
558
var exception = await Assert . ThrowsAsync < InvalidOperationException > (
552
- ( ) => tagHelper . ProcessAsync ( context , output ) ) ;
559
+ ( ) => tagHelper . ProcessAsync ( tagHelperContext , output ) ) ;
553
560
Assert . Equal ( expectedMessage , exception . Message ) ;
554
561
}
555
562
0 commit comments