@@ -184,9 +184,10 @@ public async Task ProcessAsync_GeneratesExpectedOutput(
184184 var metadata = metadataProvider . GetMetadataForProperty ( modelAccessor , containerType , propertyName : "Text" ) ;
185185 var modelExpression = new ModelExpression ( nameAndId . Name , metadata ) ;
186186
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" ) ) ;
190191 var output = new TagHelperOutput ( expectedTagName , originalAttributes )
191192 {
192193 PreContent = expectedPreContent ,
@@ -211,7 +212,7 @@ public async Task ProcessAsync_GeneratesExpectedOutput(
211212 } ;
212213
213214 // Act
214- await tagHelper . ProcessAsync ( context , output ) ;
215+ await tagHelper . ProcessAsync ( tagHelperContext , output ) ;
215216
216217 // Assert
217218 Assert . Equal ( expectedAttributes , output . Attributes ) ;
@@ -263,9 +264,10 @@ public async Task ProcessAsync_GeneratesExpectedOutput_WithItems(
263264 var metadata = metadataProvider . GetMetadataForProperty ( modelAccessor , containerType , propertyName : "Text" ) ;
264265 var modelExpression = new ModelExpression ( nameAndId . Name , metadata ) ;
265266
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" ) ) ;
269271 var output = new TagHelperOutput ( expectedTagName , originalAttributes )
270272 {
271273 PreContent = expectedPreContent ,
@@ -292,7 +294,7 @@ public async Task ProcessAsync_GeneratesExpectedOutput_WithItems(
292294 } ;
293295
294296 // Act
295- await tagHelper . ProcessAsync ( context , output ) ;
297+ await tagHelper . ProcessAsync ( tagHelperContext , output ) ;
296298
297299 // Assert
298300 Assert . Equal ( expectedAttributes , output . Attributes ) ;
@@ -329,9 +331,10 @@ public async Task ProcessAsync_CallsGeneratorWithExpectedValues_ItemsAndMultiple
329331 var propertyName = "Property1" ;
330332 var expectedTagName = "select" ;
331333
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" ) ) ;
335338 var output = new TagHelperOutput ( expectedTagName , originalAttributes ) ;
336339
337340 // TODO: https://github.com/aspnet/Mvc/issues/1253
@@ -369,7 +372,7 @@ public async Task ProcessAsync_CallsGeneratorWithExpectedValues_ItemsAndMultiple
369372 } ;
370373
371374 // Act
372- await tagHelper . ProcessAsync ( context , output ) ;
375+ await tagHelper . ProcessAsync ( tagHelperContext , output ) ;
373376
374377 // Assert
375378 htmlGenerator . Verify ( ) ;
@@ -394,9 +397,10 @@ public async Task TagHelper_CallsGeneratorWithExpectedValues_RealModelType(
394397 var propertyName = "Property1" ;
395398 var tagName = "select" ;
396399
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" ) ) ;
400404 var output = new TagHelperOutput ( tagName , originalAttributes ) ;
401405
402406 var metadataProvider = new EmptyModelMetadataProvider ( ) ;
@@ -427,7 +431,7 @@ public async Task TagHelper_CallsGeneratorWithExpectedValues_RealModelType(
427431 } ;
428432
429433 // Act
430- await tagHelper . ProcessAsync ( context , output ) ;
434+ await tagHelper . ProcessAsync ( tagHelperContext , output ) ;
431435
432436 // Assert
433437 htmlGenerator . Verify ( ) ;
@@ -462,9 +466,10 @@ public async Task ProcessAsync_RestoresMultiple_IfForNotBound(string attributeNa
462466 var expectedPostContent = "original post-content" ;
463467 var expectedTagName = "select" ;
464468
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" ) ) ;
468473 var output = new TagHelperOutput ( expectedTagName , originalAttributes )
469474 {
470475 PreContent = expectedPreContent ,
@@ -479,7 +484,7 @@ public async Task ProcessAsync_RestoresMultiple_IfForNotBound(string attributeNa
479484 } ;
480485
481486 // Act
482- await tagHelper . ProcessAsync ( context , output ) ;
487+ await tagHelper . ProcessAsync ( tagHelperContext , output ) ;
483488
484489 // Assert
485490 Assert . Equal ( expectedAttributes , output . Attributes ) ;
@@ -499,9 +504,10 @@ public async Task ProcessAsync_Throws_IfForNotBoundButItemsIs()
499504 var expectedTagName = "select" ;
500505 var expectedMessage = "Cannot determine body for <select>. 'asp-items' must be null if 'asp-for' is null." ;
501506
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" ) ) ;
505511 var output = new TagHelperOutput ( expectedTagName , originalAttributes ) ;
506512 var tagHelper = new SelectTagHelper
507513 {
@@ -510,7 +516,7 @@ public async Task ProcessAsync_Throws_IfForNotBoundButItemsIs()
510516
511517 // Act & Assert
512518 var exception = await Assert . ThrowsAsync < InvalidOperationException > (
513- ( ) => tagHelper . ProcessAsync ( context , output ) ) ;
519+ ( ) => tagHelper . ProcessAsync ( tagHelperContext , output ) ) ;
514520 Assert . Equal ( expectedMessage , exception . Message ) ;
515521 }
516522
@@ -531,9 +537,10 @@ public async Task ProcessAsync_Throws_IfMultipleInvalid(string multiple)
531537 var expectedMessage = "Cannot parse 'multiple' value '" + multiple +
532538 "' for <select>. Acceptable values are 'false', 'true' and 'multiple'." ;
533539
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" ) ) ;
537544 var output = new TagHelperOutput ( expectedTagName , originalAttributes ) ;
538545
539546 var metadataProvider = new EmptyModelMetadataProvider ( ) ;
@@ -549,7 +556,7 @@ public async Task ProcessAsync_Throws_IfMultipleInvalid(string multiple)
549556
550557 // Act & Assert
551558 var exception = await Assert . ThrowsAsync < InvalidOperationException > (
552- ( ) => tagHelper . ProcessAsync ( context , output ) ) ;
559+ ( ) => tagHelper . ProcessAsync ( tagHelperContext , output ) ) ;
553560 Assert . Equal ( expectedMessage , exception . Message ) ;
554561 }
555562
0 commit comments