508 instantiations of TagHelperAttribute
Microsoft.AspNetCore.Mvc.Razor (3)
TagHelpers\UrlResolutionTagHelper.cs (3)
166
attributes[i] = new
TagHelperAttribute
(
193
attributes[i] = new
TagHelperAttribute
(
201
attributes[i] = new
TagHelperAttribute
(
Microsoft.AspNetCore.Mvc.TagHelpers (6)
LinkTagHelper.cs (1)
282
output.Attributes[index] = new
TagHelperAttribute
(
ScriptTagHelper.cs (3)
295
output.Attributes[index] = new
TagHelperAttribute
(
441
var attribute = new
TagHelperAttribute
(srcName, srcValue, valueStyle);
454
var attribute = new
TagHelperAttribute
(srcName, srcValue, valueStyle);
TagHelperOutputExtensions.cs (2)
101
var newAttribute = new
TagHelperAttribute
(
180
var newClassAttribute = new
TagHelperAttribute
(
Microsoft.AspNetCore.Mvc.TagHelpers.Test (246)
AttributeMatcherTest.cs (9)
24
new
TagHelperAttribute
("first-attr", "value"),
25
new
TagHelperAttribute
("not-in-any-mode", "value")
49
new
TagHelperAttribute
("first-attr", "value"),
50
new
TagHelperAttribute
("second-attr", "value"),
51
new
TagHelperAttribute
("not-in-any-mode", "value")
77
new
TagHelperAttribute
("first-attr", "value"),
78
new
TagHelperAttribute
("second-attr", "value"),
79
new
TagHelperAttribute
("third-attr", "value"),
80
new
TagHelperAttribute
("not-in-any-mode", "value")
FormTagHelperTest.cs (3)
383
var expectedAttribute = new
TagHelperAttribute
("method", method.ToString().ToLowerInvariant());
443
var expectedAttribute = new
TagHelperAttribute
("asp-ROUTEE-NotRoute", "something");
1000
Assert.Equal(new
TagHelperAttribute
("aCTiON", "my-action"), attribute);
LinkTagHelperTest.cs (55)
148
new
TagHelperAttribute
("rel", new HtmlString("stylesheet"))
161
new
TagHelperAttribute
("href", "test.css")
180
new
TagHelperAttribute
("asp-fallback-href", "test.css"),
181
new
TagHelperAttribute
("asp-fallback-test-class", "hidden"),
182
new
TagHelperAttribute
("asp-fallback-test-property", "visibility"),
183
new
TagHelperAttribute
("asp-fallback-test-value", "hidden")
196
new
TagHelperAttribute
("asp-fallback-href-include", "*.css"),
197
new
TagHelperAttribute
("asp-fallback-test-class", "hidden"),
198
new
TagHelperAttribute
("asp-fallback-test-property", "visibility"),
199
new
TagHelperAttribute
("asp-fallback-test-value", "hidden")
213
new
TagHelperAttribute
("asp-fallback-href", "test.css"),
214
new
TagHelperAttribute
("asp-fallback-test-class", "hidden"),
215
new
TagHelperAttribute
("asp-fallback-test-property", "visibility"),
216
new
TagHelperAttribute
("asp-fallback-test-value", "hidden"),
217
new
TagHelperAttribute
("asp-append-version", "true")
231
new
TagHelperAttribute
("asp-fallback-href-include", "*.css"),
232
new
TagHelperAttribute
("asp-fallback-test-class", "hidden"),
233
new
TagHelperAttribute
("asp-fallback-test-property", "visibility"),
234
new
TagHelperAttribute
("asp-fallback-test-value", "hidden"),
235
new
TagHelperAttribute
("asp-append-version", "true")
250
new
TagHelperAttribute
("asp-fallback-href", "test.css"),
251
new
TagHelperAttribute
("asp-fallback-test-class", "hidden"),
252
new
TagHelperAttribute
("asp-fallback-test-property", "visibility"),
253
new
TagHelperAttribute
("asp-fallback-test-value", "hidden"),
254
new
TagHelperAttribute
("asp-append-version", "true"),
255
new
TagHelperAttribute
("asp-suppress-fallback-integrity", "true")
271
new
TagHelperAttribute
("asp-fallback-href", "test.css"),
272
new
TagHelperAttribute
("asp-fallback-test-class", "hidden"),
273
new
TagHelperAttribute
("asp-fallback-test-property", "visibility"),
274
new
TagHelperAttribute
("asp-fallback-test-value", "hidden"),
275
new
TagHelperAttribute
("asp-append-version", "true"),
276
new
TagHelperAttribute
("asp-suppress-fallback-integrity", "false")
331
new
TagHelperAttribute
("asp-href-include", "*.css")
341
new
TagHelperAttribute
("asp-href-include", "*.css"),
342
new
TagHelperAttribute
("asp-href-exclude", "*.min.css")
353
new
TagHelperAttribute
("asp-href-include", "*.css"),
354
new
TagHelperAttribute
("asp-append-version", "true")
365
new
TagHelperAttribute
("asp-href-include", "*.css"),
366
new
TagHelperAttribute
("asp-href-exclude", "*.min.css"),
367
new
TagHelperAttribute
("asp-append-version", "true")
459
new
TagHelperAttribute
("asp-href-exclude", "*.min.css")
472
new
TagHelperAttribute
("asp-fallback-test-class", "hidden"),
473
new
TagHelperAttribute
("asp-fallback-test-property", "visibility"),
474
new
TagHelperAttribute
("asp-fallback-test-value", "hidden")
487
new
TagHelperAttribute
("asp-fallback-href", "test.css"),
488
new
TagHelperAttribute
("asp-fallback-test-class", "hidden"),
491
new
TagHelperAttribute
("asp-fallback-test-value", "hidden")
505
new
TagHelperAttribute
("asp-fallback-href-exclude", "**/*.min.css"),
506
new
TagHelperAttribute
("asp-fallback-test-class", "hidden"),
507
new
TagHelperAttribute
("asp-fallback-test-property", "visibility"),
508
new
TagHelperAttribute
("asp-fallback-test-value", "hidden")
664
{ new
TagHelperAttribute
("encoded", new HtmlString("contains \"quotes\""), HtmlAttributeValueStyle.SingleQuotes) },
667
{ new
TagHelperAttribute
("mixed", mixed, HtmlAttributeValueStyle.SingleQuotes) },
673
{ new
TagHelperAttribute
("encoded", new HtmlString("contains \"quotes\""), HtmlAttributeValueStyle.SingleQuotes) },
675
{ new
TagHelperAttribute
("mixed", mixed, HtmlAttributeValueStyle.SingleQuotes) },
ScriptTagHelperTest.cs (95)
87
new
TagHelperAttribute
("data-extra", "something"),
88
new
TagHelperAttribute
("src", "/blank.js"),
89
new
TagHelperAttribute
("asp-fallback-src", "http://www.example.com/blank.js"),
90
new
TagHelperAttribute
("asp-fallback-test", "isavailable()"),
97
new
TagHelperAttribute
("data-extra", new HtmlString("something"))
107
expectedAttributes.Add(new
TagHelperAttribute
("src", "/blank.js"));
125
new
TagHelperAttribute
("asp-fallback-src", "test.js"),
126
new
TagHelperAttribute
("asp-fallback-test", "isavailable()")
137
new
TagHelperAttribute
("asp-fallback-src", "test.js"),
138
new
TagHelperAttribute
("asp-fallback-test", "isavailable()"),
139
new
TagHelperAttribute
("asp-suppress-fallback-integrity", "false")
151
new
TagHelperAttribute
("asp-fallback-src-include", "*.js"),
152
new
TagHelperAttribute
("asp-fallback-test", "isavailable()")
163
new
TagHelperAttribute
("asp-fallback-src", "test.js"),
164
new
TagHelperAttribute
("asp-fallback-src-include", "*.js"),
165
new
TagHelperAttribute
("asp-fallback-test", "isavailable()")
177
new
TagHelperAttribute
("asp-fallback-src", "test.js"),
178
new
TagHelperAttribute
("asp-fallback-src-include", "*.js"),
179
new
TagHelperAttribute
("asp-fallback-test", "isavailable()"),
180
new
TagHelperAttribute
("asp-suppress-fallback-integrity", "false")
193
new
TagHelperAttribute
("asp-fallback-src-include", "*.js"),
194
new
TagHelperAttribute
("asp-fallback-src-exclude", "*.min.js"),
195
new
TagHelperAttribute
("asp-fallback-test", "isavailable()")
208
new
TagHelperAttribute
("asp-fallback-src", "test.js"),
209
new
TagHelperAttribute
("asp-fallback-test", "isavailable()"),
210
new
TagHelperAttribute
("asp-append-version", "true")
222
new
TagHelperAttribute
("asp-fallback-src-include", "*.js"),
223
new
TagHelperAttribute
("asp-fallback-test", "isavailable()"),
224
new
TagHelperAttribute
("asp-append-version", "true")
236
new
TagHelperAttribute
("asp-fallback-src", "test.js"),
237
new
TagHelperAttribute
("asp-fallback-src-include", "*.js"),
238
new
TagHelperAttribute
("asp-fallback-test", "isavailable()"),
239
new
TagHelperAttribute
("asp-append-version", "true")
252
new
TagHelperAttribute
("asp-fallback-src-include", "*.js"),
253
new
TagHelperAttribute
("asp-fallback-src-exclude", "*.min.js"),
254
new
TagHelperAttribute
("asp-fallback-test", "isavailable()"),
255
new
TagHelperAttribute
("asp-append-version", "true")
307
new
TagHelperAttribute
("asp-src-include", "*.js")
317
new
TagHelperAttribute
("asp-src-include", "*.js"),
318
new
TagHelperAttribute
("asp-src-exclude", "*.min.js")
329
new
TagHelperAttribute
("asp-src-include", "*.js"),
330
new
TagHelperAttribute
("asp-append-version", "true")
341
new
TagHelperAttribute
("asp-src-include", "*.js"),
342
new
TagHelperAttribute
("asp-src-exclude", "*.min.js"),
343
new
TagHelperAttribute
("asp-append-version", "true")
397
new
TagHelperAttribute
("asp-src-exclude", "*.min.js")
410
new
TagHelperAttribute
("asp-fallback-test", "isavailable()"),
421
new
TagHelperAttribute
("asp-fallback-src", "test.js"),
436
new
TagHelperAttribute
("asp-fallback-src-exclude", "**/*.min.js"),
437
new
TagHelperAttribute
("asp-fallback-test", "isavailable()"),
501
new
TagHelperAttribute
("data-extra", "something"),
502
new
TagHelperAttribute
("src", "/blank.js"),
503
new
TagHelperAttribute
("data-more", "else"),
504
new
TagHelperAttribute
("asp-fallback-src", "http://www.example.com/blank.js"),
505
new
TagHelperAttribute
("asp-fallback-test", "isavailable()"),
511
new
TagHelperAttribute
("data-extra", "something"),
512
new
TagHelperAttribute
("data-more", "else"),
538
new
TagHelperAttribute
("src", "/js/site.js"),
539
new
TagHelperAttribute
("asp-src-include", "**/*.js")
582
{ new
TagHelperAttribute
("encoded", new HtmlString("contains \"quotes\""), HtmlAttributeValueStyle.SingleQuotes) },
584
{ new
TagHelperAttribute
("mixed", mixed, HtmlAttributeValueStyle.SingleQuotes) },
591
{ new
TagHelperAttribute
("encoded", new HtmlString("contains \"quotes\""), HtmlAttributeValueStyle.SingleQuotes) },
593
{ new
TagHelperAttribute
("mixed", mixed, HtmlAttributeValueStyle.SingleQuotes) },
624
new
TagHelperAttribute
("src", "/js/site.js"),
625
new
TagHelperAttribute
("asp-append-version", "true")
651
new
TagHelperAttribute
("src", src),
652
new
TagHelperAttribute
("asp-append-version", "true")
680
new
TagHelperAttribute
("src", path),
681
new
TagHelperAttribute
("asp-append-version", "true")
736
new
TagHelperAttribute
("type", "importmap"),
737
new
TagHelperAttribute
("asp-importmap", importMap)
781
new
TagHelperAttribute
("type", "importmap"),
818
new
TagHelperAttribute
("src", "/bar/js/site.js"),
819
new
TagHelperAttribute
("asp-append-version", "true")
843
new
TagHelperAttribute
("src", "/js/site.js"),
844
new
TagHelperAttribute
("asp-fallback-src-include", "fallback.js"),
845
new
TagHelperAttribute
("asp-fallback-test", "isavailable()"),
846
new
TagHelperAttribute
("asp-append-version", "true")
874
new
TagHelperAttribute
("src", "/js/site.js"),
875
new
TagHelperAttribute
("asp-fallback-src-include", "fallback.js"),
876
new
TagHelperAttribute
("asp-fallback-test", "isavailable()"),
877
new
TagHelperAttribute
("asp-append-version", "true")
921
{ new
TagHelperAttribute
("encoded", new HtmlString("contains \"quotes\""), HtmlAttributeValueStyle.SingleQuotes) },
923
{ new
TagHelperAttribute
("mixed", mixed, HtmlAttributeValueStyle.SingleQuotes) },
930
{ new
TagHelperAttribute
("encoded", new HtmlString("contains \"quotes\""), HtmlAttributeValueStyle.SingleQuotes) },
932
{ new
TagHelperAttribute
("mixed", mixed, HtmlAttributeValueStyle.SingleQuotes) },
961
new
TagHelperAttribute
("src", "/js/site.js"),
962
new
TagHelperAttribute
("asp-src-include", "*.js"),
963
new
TagHelperAttribute
("asp-append-version", "true")
999
new
TagHelperAttribute
("src", "/js/site.js"),
1000
new
TagHelperAttribute
("asp-src-include", "*.js"),
1001
new
TagHelperAttribute
("asp-append-version", "true")
1037
new
TagHelperAttribute
("src", path),
1038
new
TagHelperAttribute
("type", "module"),
1039
new
TagHelperAttribute
("asp-append-version", "true")
TagHelperOutputExtensionsTest.cs (77)
39
new
TagHelperAttribute
("first", "A"),
40
new
TagHelperAttribute
("second", "B"),
57
new
TagHelperAttribute
("second", "B"),
58
new
TagHelperAttribute
("second", "Duplicate B"),
59
new
TagHelperAttribute
("first", "A"),
76
new
TagHelperAttribute
("second", "B"),
77
new
TagHelperAttribute
("first", "A"),
78
new
TagHelperAttribute
("second", "Duplicate B"),
94
new
TagHelperAttribute
("first", "A"),
95
new
TagHelperAttribute
("second", "B"),
96
new
TagHelperAttribute
("dynamic", "value"),
113
new
TagHelperAttribute
("first", "A"),
114
new
TagHelperAttribute
("dynamic", "value"),
115
new
TagHelperAttribute
("secondDynamic", "another value"),
116
new
TagHelperAttribute
("second", "B"),
134
new
TagHelperAttribute
("first", "A"),
135
new
TagHelperAttribute
("second", "B"),
136
new
TagHelperAttribute
("dynamic", "value"),
137
new
TagHelperAttribute
("secondDynamic", "another value"),
156
new
TagHelperAttribute
("first", "A"),
157
new
TagHelperAttribute
("third", "C"),
158
new
TagHelperAttribute
("dynamic", "value"),
159
new
TagHelperAttribute
("secondDynamic", "another value"),
178
new
TagHelperAttribute
("first", "A"),
179
new
TagHelperAttribute
("third", "C"),
180
new
TagHelperAttribute
("dynamic", "value"),
181
new
TagHelperAttribute
("secondDynamic", "another value"),
201
new
TagHelperAttribute
("third", "C"),
202
new
TagHelperAttribute
("dynamic", "value"),
203
new
TagHelperAttribute
("first", "A"),
204
new
TagHelperAttribute
("secondDynamic", "another value"),
226
new
TagHelperAttribute
("third", "C"),
227
new
TagHelperAttribute
("first", "third first"),
228
new
TagHelperAttribute
("dynamic", "value"),
229
new
TagHelperAttribute
("first", "A"),
230
new
TagHelperAttribute
("secondDynamic", "another value"),
231
new
TagHelperAttribute
("first", "Second first"),
249
new
TagHelperAttribute
("third", "C"),
250
new
TagHelperAttribute
("first", "A"),
251
new
TagHelperAttribute
("third", "Duplicate Third"),
269
new
TagHelperAttribute
("third", "C"),
270
new
TagHelperAttribute
("first", "A"),
271
new
TagHelperAttribute
("third", "Duplicate Third"),
289
new
TagHelperAttribute
("first", "A"),
290
new
TagHelperAttribute
("first", "C"),
291
new
TagHelperAttribute
("first", "B"),
292
new
TagHelperAttribute
("third", "D"),
313
new
TagHelperAttribute
("third", "D"),
314
new
TagHelperAttribute
("first", "A"),
315
new
TagHelperAttribute
("first", "B"),
316
new
TagHelperAttribute
("first", "C"),
317
new
TagHelperAttribute
("dynamic", "value"),
318
new
TagHelperAttribute
("third", "Duplicate Third"),
368
new
TagHelperAttribute
("hello", "world"),
369
new
TagHelperAttribute
("hello", "world2"),
381
new
TagHelperAttribute
("hello", "world"),
382
new
TagHelperAttribute
("hello", "world2"),
394
new
TagHelperAttribute
("HelLO", "world"),
395
new
TagHelperAttribute
("HELLO", "world2"),
407
new
TagHelperAttribute
("hello", "world"),
408
new
TagHelperAttribute
("HELLO", "world2"),
420
new
TagHelperAttribute
("HeLlO", "world"),
421
new
TagHelperAttribute
("heLLo", "world2"),
477
var expectedAttribute = new
TagHelperAttribute
(attributeName, attributeValue);
504
var expectedAttribute = new
TagHelperAttribute
(attributeName, "world2");
565
var expectedAttribute = new
TagHelperAttribute
("type", "btn");
593
var expectedAttribute = new
TagHelperAttribute
("type", "btn");
619
var expectedAttribute = new
TagHelperAttribute
("type", "btn");
804
var expectedAttribute = new
TagHelperAttribute
("type", "btn");
832
var expectedAttribute = new
TagHelperAttribute
("class", "Hello btn");
866
new
TagHelperAttribute
(originalName, "Hello btn"),
882
var expectedAttribute = new
TagHelperAttribute
("visible", "val < 3");
904
var expectedAttribute1 = new
TagHelperAttribute
("class", "btn");
905
var expectedAttribute2 = new
TagHelperAttribute
("class2", "btn");
929
var expectedAttribute = new
TagHelperAttribute
("class", "btn");
951
var expectedOutputAttribute = new
TagHelperAttribute
("class", "btn");
955
var expectedBuilderAttribute = new
TagHelperAttribute
("for", "hello");
ValidationSummaryTagHelperTest.cs (7)
49
new
TagHelperAttribute
("class", "form-control validation-summary-valid"),
50
new
TagHelperAttribute
("data-valmsg-summary", "true"),
257
new
TagHelperAttribute
("class", "form-control validation-summary-errors"),
278
new
TagHelperAttribute
("class", "form-control validation-summary-errors"),
279
new
TagHelperAttribute
("data-valmsg-summary", "true"),
594
new
TagHelperAttribute
("class", "form-control validation-summary-errors"),
595
new
TagHelperAttribute
("data-valmsg-summary", "true"),
Microsoft.AspNetCore.Razor (2)
TagHelpers\TagHelperAttributeList.cs (2)
73
var attribute = new
TagHelperAttribute
(name, value);
131
var attribute = new
TagHelperAttribute
(name, value);
Microsoft.AspNetCore.Razor.Runtime (2)
Runtime\TagHelpers\TagHelperExecutionContext.cs (2)
127
var attribute = new
TagHelperAttribute
(name, value, valueStyle);
153
var attribute = new
TagHelperAttribute
(name, value, valueStyle);
Microsoft.AspNetCore.Razor.Runtime.Test (18)
Runtime\TagHelpers\TagHelperExecutionContextTest.cs (17)
117
executionContext.AddHtmlAttribute(new
TagHelperAttribute
("something"));
126
executionContext.AddHtmlAttribute(new
TagHelperAttribute
("Another attribute"));
169
executionContext.AddHtmlAttribute(new
TagHelperAttribute
("something"));
178
executionContext.AddHtmlAttribute(new
TagHelperAttribute
("Another attribute"));
456
expectedAttributes.Add(new
TagHelperAttribute
("type", "text", HtmlAttributeValueStyle.SingleQuotes));
477
new
TagHelperAttribute
("checked"),
478
new
TagHelperAttribute
("visible"),
482
executionContext.AddHtmlAttribute(new
TagHelperAttribute
("checked"));
483
executionContext.AddHtmlAttribute(new
TagHelperAttribute
("visible"));
503
expectedAttributes.Add(new
TagHelperAttribute
("valid", "true", HtmlAttributeValueStyle.NoQuotes));
504
expectedAttributes.Add(new
TagHelperAttribute
("type", "text", HtmlAttributeValueStyle.SingleQuotes));
505
expectedAttributes.Add(new
TagHelperAttribute
(name: "checked"));
506
expectedAttributes.Add(new
TagHelperAttribute
(name: "visible"));
513
executionContext.AddHtmlAttribute(new
TagHelperAttribute
("checked"));
514
executionContext.AddHtmlAttribute(new
TagHelperAttribute
("visible"));
533
expectedAttributes.Add(new
TagHelperAttribute
("something", true, HtmlAttributeValueStyle.SingleQuotes));
534
expectedAttributes.Add(new
TagHelperAttribute
("type", "text", HtmlAttributeValueStyle.NoQuotes));
Runtime\TagHelpers\TagHelperRunnerTest.cs (1)
219
output.Attributes[classIndex] = new
TagHelperAttribute
("class", "somethingelse");
Microsoft.AspNetCore.Razor.Test (230)
TagHelpers\ReadOnlyTagHelperAttributeListTest.cs (143)
14
var first = new
TagHelperAttribute
("First", "First Value");
15
var second = new
TagHelperAttribute
("Second", "Second Value");
16
var third = new
TagHelperAttribute
("Third", "Third Value");
58
var first = new
TagHelperAttribute
("First", "First Value");
59
var second = new
TagHelperAttribute
("Second", "Second Value");
60
var third = new
TagHelperAttribute
("Third", "Third Value");
110
new
TagHelperAttribute
("a", "av"),
111
new
TagHelperAttribute
("b", "bv")
122
var A = new
TagHelperAttribute
("AName", "AName Value");
123
var A2 = new
TagHelperAttribute
("aname", "AName Second Value");
124
var A3 = new
TagHelperAttribute
("AName", "AName Third Value");
125
var B = new
TagHelperAttribute
("BName", "BName Value");
126
var C = new
TagHelperAttribute
("CName", "CName Value");
193
new
TagHelperAttribute
("A"),
194
new
TagHelperAttribute
("B"),
195
new
TagHelperAttribute
("C")
209
var A = new
TagHelperAttribute
("AName", "AName Value");
210
var A2 = new
TagHelperAttribute
("aname", "AName Second Value");
211
var A3 = new
TagHelperAttribute
("AName", "AName Third Value");
212
var B = new
TagHelperAttribute
("BName", "BName Value");
213
var C = new
TagHelperAttribute
("CName", "CName Value");
221
{ new[] { A }, new
TagHelperAttribute
(A.Name, A.Value), true },
222
{ new[] { A }, new
TagHelperAttribute
("aname", A.Value), true },
224
{ new[] { A, B }, new
TagHelperAttribute
(A.Name, A.Value), true },
225
{ new[] { A, B }, new
TagHelperAttribute
("AnaMe", A.Value), true },
227
{ new[] { A, B }, new
TagHelperAttribute
(B.Name, B.Value), true },
228
{ new[] { A, B }, new
TagHelperAttribute
("BNAME", B.Value), true },
230
{ new[] { A, B, C }, new
TagHelperAttribute
(B.Name, B.Value), true },
231
{ new[] { A, B, C }, new
TagHelperAttribute
("bname", B.Value), true },
233
{ new[] { A, B, C }, new
TagHelperAttribute
(C.Name, C.Value), true },
234
{ new[] { A, B, C }, new
TagHelperAttribute
("CNAme", C.Value), true },
236
{ new[] { A }, new
TagHelperAttribute
(A.Name, "different value"), false },
237
{ new[] { A }, new
TagHelperAttribute
("aname_not", "different value"), false },
239
{ new[] { A, B }, new
TagHelperAttribute
(A.Name, "different value"), false },
240
{ new[] { A, B }, new
TagHelperAttribute
("AnaMe_not", "different value"), false },
241
{ new[] { A, B }, new
TagHelperAttribute
(B.Name, "different value"), false },
242
{ new[] { A, B }, new
TagHelperAttribute
("BNAME_not", "different value"), false },
244
{ new[] { A, B, C }, new
TagHelperAttribute
(B.Name, "different value"), false },
245
{ new[] { A, B, C }, new
TagHelperAttribute
("bname_not", "different value"), false },
246
{ new[] { A, B, C }, new
TagHelperAttribute
(C.Name, "different value"), false },
247
{ new[] { A, B, C }, new
TagHelperAttribute
("CNAme_not", "different value"), false },
251
{ new[] { A, B, A2, C }, new
TagHelperAttribute
(A.Name, A.Value), true },
252
{ new[] { A, B, A2, C }, new
TagHelperAttribute
("aname", A.Value), true },
254
{ new[] { B, A2, A }, new
TagHelperAttribute
(A.Name, A.Value), true },
255
{ new[] { B, A2, A }, new
TagHelperAttribute
("AnAME", A2.Value), true },
257
{ new[] { B, A2, A, C }, new
TagHelperAttribute
(A.Name, A.Value), true },
258
{ new[] { B, A2, A, C }, new
TagHelperAttribute
("ANAME", A.Value), true },
260
{ new[] { A, A3 }, new
TagHelperAttribute
(A.Name, A.Value), true },
261
{ new[] { A, A3 }, new
TagHelperAttribute
("ANamE", A.Value), true },
263
{ new[] { A3, A }, new
TagHelperAttribute
(A3.Name, A3.Value), true },
264
{ new[] { A3, A }, new
TagHelperAttribute
("anamE", A3.Value), true },
266
{ new[] { A, A2, A3 }, new
TagHelperAttribute
(A.Name, A.Value), true },
267
{ new[] { A, A2, A3 }, new
TagHelperAttribute
("ANAme", A.Value), true },
269
{ new[] { C, B, A3, A }, new
TagHelperAttribute
(A3.Name, A3.Value), true },
270
{ new[] { C, B, A3, A }, new
TagHelperAttribute
("aname", A3.Value), true },
272
{ new[] { A, B, A2, C }, new
TagHelperAttribute
(A.Name, A3.Value), false },
273
{ new[] { A, B, A2, C }, new
TagHelperAttribute
("aname_not", "different value"), false },
275
{ new[] { B, A2, A }, new
TagHelperAttribute
(A.Name, A3.Value), false },
276
{ new[] { B, A2, A }, new
TagHelperAttribute
("AnAME_not", "different value"), false },
278
{ new[] { B, A2, A, C }, new
TagHelperAttribute
(A.Name, A3.Value), false },
279
{ new[] { B, A2, A, C }, new
TagHelperAttribute
("ANAME_not", "different value"), false },
281
{ new[] { A, A3 }, new
TagHelperAttribute
(A.Name, A2.Value), false },
282
{ new[] { A, A3 }, new
TagHelperAttribute
("ANamE_not", "different value"), false },
284
{ new[] { A3, A }, new
TagHelperAttribute
(A3.Name, A2.Value), false },
285
{ new[] { A3, A }, new
TagHelperAttribute
("anamE_not", "different value"), false },
287
{ new[] { A, A2, A3 }, new
TagHelperAttribute
(A.Name, B.Value), false },
288
{ new[] { A, A2, A3 }, new
TagHelperAttribute
("ANAme_not", "different value"), false },
290
{ new[] { C, B, A3, A }, new
TagHelperAttribute
(A3.Name, A2.Value), false },
291
{ new[] { C, B, A3, A }, new
TagHelperAttribute
("aname_not", "different value"), false },
317
var A = new
TagHelperAttribute
("AName", "AName Value");
318
var A2 = new
TagHelperAttribute
("aname", "AName Second Value");
319
var A3 = new
TagHelperAttribute
("AName", "AName Third Value");
320
var B = new
TagHelperAttribute
("BName", "BName Value");
321
var C = new
TagHelperAttribute
("CName", "CName Value");
393
var A = new
TagHelperAttribute
("AName", "AName Value");
394
var A2 = new
TagHelperAttribute
("aname", "AName Second Value");
395
var A3 = new
TagHelperAttribute
("AName", "AName Third Value");
396
var B = new
TagHelperAttribute
("BName", "BName Value");
397
var C = new
TagHelperAttribute
("CName", "CName Value");
405
{ new[] { A }, new
TagHelperAttribute
(A.Name, A.Value), 0 },
406
{ new[] { A }, new
TagHelperAttribute
("aname", A.Value), 0 },
408
{ new[] { A, B }, new
TagHelperAttribute
(A.Name, A.Value), 0 },
409
{ new[] { A, B }, new
TagHelperAttribute
("AnaMe", A.Value), 0 },
411
{ new[] { A, B }, new
TagHelperAttribute
(B.Name, B.Value), 1 },
412
{ new[] { A, B }, new
TagHelperAttribute
("BNAME", B.Value), 1 },
414
{ new[] { A, B, C }, new
TagHelperAttribute
(B.Name, B.Value), 1 },
415
{ new[] { A, B, C }, new
TagHelperAttribute
("bname", B.Value), 1 },
417
{ new[] { A, B, C }, new
TagHelperAttribute
(C.Name, C.Value), 2 },
418
{ new[] { A, B, C }, new
TagHelperAttribute
("CNAme", C.Value), 2 },
420
{ new[] { A }, new
TagHelperAttribute
(A.Name, "different value"), -1 },
421
{ new[] { A }, new
TagHelperAttribute
("aname_not", "different value"), -1 },
423
{ new[] { A, B }, new
TagHelperAttribute
(A.Name, "different value"), -1 },
424
{ new[] { A, B }, new
TagHelperAttribute
("AnaMe_not", "different value"), -1 },
425
{ new[] { A, B }, new
TagHelperAttribute
(B.Name, "different value"), -1 },
426
{ new[] { A, B }, new
TagHelperAttribute
("BNAME_not", "different value"), -1 },
428
{ new[] { A, B, C }, new
TagHelperAttribute
(B.Name, "different value"), -1 },
429
{ new[] { A, B, C }, new
TagHelperAttribute
("bname_not", "different value"), -1 },
430
{ new[] { A, B, C }, new
TagHelperAttribute
(C.Name, "different value"), -1 },
431
{ new[] { A, B, C }, new
TagHelperAttribute
("CNAme_not", "different value"), -1 },
435
{ new[] { A, B, A2, C }, new
TagHelperAttribute
(A.Name, A.Value), 0 },
436
{ new[] { A, B, A2, C }, new
TagHelperAttribute
("aname", A.Value), 0 },
438
{ new[] { B, A2, A }, new
TagHelperAttribute
(A.Name, A.Value), 2 },
439
{ new[] { B, A2, A }, new
TagHelperAttribute
("AnAME", A2.Value), 1 },
441
{ new[] { B, A2, A, C }, new
TagHelperAttribute
(A.Name, A.Value), 2 },
442
{ new[] { B, A2, A, C }, new
TagHelperAttribute
("ANAME", A.Value), 2 },
444
{ new[] { A, A3 }, new
TagHelperAttribute
(A.Name, A.Value), 0 },
445
{ new[] { A, A3 }, new
TagHelperAttribute
("ANamE", A.Value), 0 },
447
{ new[] { A3, A }, new
TagHelperAttribute
(A3.Name, A3.Value), 0 },
448
{ new[] { A3, A }, new
TagHelperAttribute
("anamE", A3.Value), 0 },
450
{ new[] { A, A2, A3 }, new
TagHelperAttribute
(A.Name, A.Value), 0 },
451
{ new[] { A, A2, A3 }, new
TagHelperAttribute
("ANAme", A.Value), 0 },
453
{ new[] { C, B, A3, A }, new
TagHelperAttribute
(A3.Name, A3.Value), 2 },
454
{ new[] { C, B, A3, A }, new
TagHelperAttribute
("aname", A3.Value), 2 },
456
{ new[] { A, B, A2, C }, new
TagHelperAttribute
(A.Name, A3.Value), -1 },
457
{ new[] { A, B, A2, C }, new
TagHelperAttribute
("aname_not", "different value"), -1 },
459
{ new[] { B, A2, A }, new
TagHelperAttribute
(A.Name, A3.Value), -1 },
460
{ new[] { B, A2, A }, new
TagHelperAttribute
("AnAME_not", "different value"), -1 },
462
{ new[] { B, A2, A, C }, new
TagHelperAttribute
(A.Name, A3.Value), -1 },
463
{ new[] { B, A2, A, C }, new
TagHelperAttribute
("ANAME_not", "different value"), -1 },
465
{ new[] { A, A3 }, new
TagHelperAttribute
(A.Name, A2.Value), -1 },
466
{ new[] { A, A3 }, new
TagHelperAttribute
("ANamE_not", "different value"), -1 },
468
{ new[] { A3, A }, new
TagHelperAttribute
(A3.Name, A2.Value), -1 },
469
{ new[] { A3, A }, new
TagHelperAttribute
("anamE_not", "different value"), -1 },
471
{ new[] { A, A2, A3 }, new
TagHelperAttribute
(A.Name, B.Value), -1 },
472
{ new[] { A, A2, A3 }, new
TagHelperAttribute
("ANAme_not", "different value"), -1 },
474
{ new[] { C, B, A3, A }, new
TagHelperAttribute
(A3.Name, A2.Value), -1 },
475
{ new[] { C, B, A3, A }, new
TagHelperAttribute
("aname_not", "different value"), -1 },
501
var A = new
TagHelperAttribute
("AName", "AName Value");
502
var A2 = new
TagHelperAttribute
("aname", "AName Second Value");
503
var A3 = new
TagHelperAttribute
("AName", "AName Third Value");
504
var B = new
TagHelperAttribute
("BName", "BName Value");
505
var C = new
TagHelperAttribute
("CName", "CName Value");
573
var A = new
TagHelperAttribute
("AName", "AName Value");
574
var A2 = new
TagHelperAttribute
("aname", "AName Second Value");
575
var A3 = new
TagHelperAttribute
("AName", "AName Third Value");
576
var B = new
TagHelperAttribute
("BName", "BName Value");
577
var C = new
TagHelperAttribute
("CName", "CName Value");
647
new
TagHelperAttribute
("A", "AV"),
648
new
TagHelperAttribute
("B", "BV")
664
new
TagHelperAttribute
("A", "AV"),
665
new
TagHelperAttribute
("B", "BV")
679
new
TagHelperAttribute
("A", "AV"),
680
new
TagHelperAttribute
("B", "BV")
TagHelpers\TagHelperAttributeListTest.cs (75)
33
var first = new
TagHelperAttribute
("First", "First Value");
34
var second = new
TagHelperAttribute
("Second", "Second Value");
35
var third = new
TagHelperAttribute
("Third", "Third Value");
36
var set = new
TagHelperAttribute
("Set", "Set Value");
81
new
TagHelperAttribute
("A", "AV"),
82
new
TagHelperAttribute
("B", "BV")
98
new
TagHelperAttribute
("A", "AV"),
99
new
TagHelperAttribute
("B", "BV")
105
attributes[index] = new
TagHelperAttribute
("C", "CV");
132
var A = new
TagHelperAttribute
("AName", "AName Value");
133
var ASet1 = new
TagHelperAttribute
("AName", "AName Set Value");
134
var ASet2 = new
TagHelperAttribute
("AnAmE", "AName Set Value");
135
var A2 = new
TagHelperAttribute
("aname", "AName Second Value");
136
var A3 = new
TagHelperAttribute
("AName", "AName Third Value");
137
var A3Set = new
TagHelperAttribute
("aname", "AName Third Set Value");
138
var B = new
TagHelperAttribute
("BName", "BName Value");
139
var BSet1 = new
TagHelperAttribute
("BName", "BName Set Value");
140
var BSet2 = new
TagHelperAttribute
("BnAmE", "BName Set Value");
141
var C = new
TagHelperAttribute
("CName", "CName Value");
142
var CSet1 = new
TagHelperAttribute
("CName", "CName Set Value");
143
var CSet2 = new
TagHelperAttribute
("cnamE", "CName Set Value");
144
var set = new
TagHelperAttribute
("Set", "Set Value");
204
new
TagHelperAttribute
("A", "AV"),
205
new
TagHelperAttribute
("B", "BV")
211
attributes[2] = new
TagHelperAttribute
("C", "CV");
232
var A = new
TagHelperAttribute
("AName", "AName Value");
233
var A2 = new
TagHelperAttribute
("aname", "AName Second Value");
234
var B = new
TagHelperAttribute
("BName", "BName Value");
269
var A = new
TagHelperAttribute
("AName", "AName Value");
270
var A2 = new
TagHelperAttribute
("aname", "AName Second Value");
271
var B = new
TagHelperAttribute
("BName", "BName Value");
316
new
TagHelperAttribute
("a", "av"),
317
new
TagHelperAttribute
("b", "bv"),
322
() => attributes.Insert(3, new
TagHelperAttribute
("c", "cb")));
329
var A = new
TagHelperAttribute
("AName", "AName Value");
330
var A2 = new
TagHelperAttribute
("aname", "AName Second Value");
331
var B = new
TagHelperAttribute
("BName", "BName Value");
379
var A = new
TagHelperAttribute
("AName", "AName Value");
380
var A2 = new
TagHelperAttribute
("aname", "AName Second Value");
381
var A3 = new
TagHelperAttribute
("AName", "AName Third Value");
382
var B = new
TagHelperAttribute
("BName", "BName Value");
383
var C = new
TagHelperAttribute
("CName", "CName Value");
451
var A = new
TagHelperAttribute
("AName", "av");
452
var A2 = new
TagHelperAttribute
("aname", "av");
453
var A3 = new
TagHelperAttribute
("AName", "av");
454
var B = new
TagHelperAttribute
("BName", "bv");
455
var C = new
TagHelperAttribute
("CName", "cv");
465
{ new[] { A }, new
TagHelperAttribute
("AnAmE", "av"), empty, true },
467
{ new[] { A, B }, new
TagHelperAttribute
("AnAmE", "av"), new[] { B }, true },
469
{ new[] { A, B }, new
TagHelperAttribute
("BnAmE", "bv"), new[] { A }, true },
471
{ new[] { A, B, C }, new
TagHelperAttribute
("bname", "bv"), new[] { A, C }, true },
473
{ new[] { A, B, C }, new
TagHelperAttribute
("cnamE", "cv"), new[] { A, B }, true },
477
{ new[] { A, B, A2, C }, new
TagHelperAttribute
("aname", "av"), new[] { B, A2, C }, true },
478
{ new[] { B, A2, A }, new
TagHelperAttribute
("aname", "av"), new[] { B, A }, true },
481
{ new[] { A3, A }, new
TagHelperAttribute
("aname", "av"), new[] { A }, true },
482
{ new[] { A, A2, A3 }, new
TagHelperAttribute
("AName", "av"), new[] { A2, A3 }, true },
483
{ new[] { C, B, A3, A }, new
TagHelperAttribute
("AName", "av"), new[] { C, B, A }, true },
486
{ Enumerable.Empty<TagHelperAttribute>(), new
TagHelperAttribute
("DoesNotExist", "_0_"), Enumerable.Empty<TagHelperAttribute>(), false },
487
{ new[] { A }, new
TagHelperAttribute
("DoesNotExist", "_AName_"), new[] { A }, false },
488
{ new[] { A }, new
TagHelperAttribute
("DoesNotExist", "completely different"), new[] { A }, false },
489
{ new[] { A, B }, new
TagHelperAttribute
("DoesNotExist", "_AName_"), new[] { A, B }, false },
490
{ new[] { A, B }, new
TagHelperAttribute
("DoesNotExist", "completely different"), new[] { A, B }, false },
491
{ new[] { A, B, C }, new
TagHelperAttribute
("DoesNotExist", "_BName_"), new[] { A, B, C }, false },
492
{ new[] { A, B, C }, new
TagHelperAttribute
("DoesNotExist", "completely different"), new[] { A, B, C }, false },
493
{ new[] { A, A2, B, C }, new
TagHelperAttribute
("DoesNotExist", "_cnamE_"), new[] { A, A2, B, C }, false },
494
{ new[] { A, A2, B, C }, new
TagHelperAttribute
("DoesNotExist", "completely different"), new[] { A, A2, B, C }, false },
495
{ new[] { A, A2, A3, B, C }, new
TagHelperAttribute
("DoesNotExist", "_cnamE_"), new[] { A, A2, A3, B, C }, false },
496
{ new[] { A, A2, A3, B, C }, new
TagHelperAttribute
("DoesNotExist", "completely different"), new[] { A, A2, A3, B, C }, false },
524
var A = new
TagHelperAttribute
("AName", "AName Value");
525
var A2 = new
TagHelperAttribute
("aname", "AName Second Value");
526
var B = new
TagHelperAttribute
("BName", "BName Value");
569
new
TagHelperAttribute
("a", "av"),
570
new
TagHelperAttribute
("b", "bv"),
585
new
TagHelperAttribute
("a", "av"),
586
new
TagHelperAttribute
("b", "bv"),
TagHelpers\TagHelperOutputTest.cs (12)
397
new
TagHelperAttribute
(updateName, "super button"),
479
{ new
TagHelperAttribute
("test", "testVal", HtmlAttributeValueStyle.NoQuotes) },
480
{ new
TagHelperAttribute
("something", " spaced ", HtmlAttributeValueStyle.SingleQuotes) },
495
new
TagHelperAttribute
("test"),
510
new
TagHelperAttribute
("test"),
511
new
TagHelperAttribute
("test2"),
526
new
TagHelperAttribute
("first", "unminimized"),
527
new
TagHelperAttribute
("test"),
542
new
TagHelperAttribute
("test"),
543
new
TagHelperAttribute
("last", "unminimized", HtmlAttributeValueStyle.NoQuotes),
586
{ new
TagHelperAttribute
("test", "testVal", HtmlAttributeValueStyle.SingleQuotes) }
797
{ new
TagHelperAttribute
("test", "testVal", HtmlAttributeValueStyle.SingleQuotes) }
TagHelpersWebSite (1)
TagHelpers\AddProcessedAttributeTagHelper.cs (1)
13
output.Attributes.Add(new
TagHelperAttribute
("processed"));
527 references to TagHelperAttribute
Microsoft.AspNetCore.Mvc.Razor (2)
TagHelpers\UrlResolutionTagHelper.cs (2)
142
/// <see cref="
TagHelperAttribute
.Name"/> is <paramref name="attributeName"/>.
156
var
attribute = attributes[i];
Microsoft.AspNetCore.Mvc.Razor.Test (36)
RazorPageTest.cs (9)
996
var
htmlAttribute = Assert.Single(output.Attributes);
1003
var
allAttribute = Assert.Single(context.AllAttributes);
1041
var
htmlAttribute = Assert.Single(output.Attributes);
1048
var
allAttribute = Assert.Single(context.AllAttributes);
1087
var
htmlAttribute = Assert.Single(output.Attributes);
1094
var
allAttribute = Assert.Single(context.AllAttributes);
1129
var
attribute = Assert.Single(context.AllAttributes);
1157
var
htmlAttribute = Assert.Single(output.Attributes);
1162
var
allAttribute = Assert.Single(context.AllAttributes);
src\Shared\Razor\CaseSensitiveBoundAttributeComparer.cs (4)
11
internal sealed class CaseSensitiveTagHelperAttributeComparer : IEqualityComparer<
TagHelperAttribute
>
20
public bool Equals(
TagHelperAttribute
attributeX,
TagHelperAttribute
attributeY)
35
public int GetHashCode(
TagHelperAttribute
attribute)
TagHelpers\TagHelperComponentTagHelperTest.cs (8)
24
Enumerable.Empty<
TagHelperAttribute
>()),
73
Enumerable.Empty<
TagHelperAttribute
>()),
129
Enumerable.Empty<
TagHelperAttribute
>()),
160
Enumerable.Empty<
TagHelperAttribute
>()),
191
Enumerable.Empty<
TagHelperAttribute
>()),
226
Enumerable.Empty<
TagHelperAttribute
>()),
259
Enumerable.Empty<
TagHelperAttribute
>()),
290
Enumerable.Empty<
TagHelperAttribute
>()),
TagHelpers\UrlResolutionTagHelperTest.cs (15)
79
Enumerable.Empty<
TagHelperAttribute
>()),
87
var
attribute = Assert.Single(tagHelperOutput.Attributes);
121
Enumerable.Empty<
TagHelperAttribute
>()),
129
var
attribute = Assert.Single(tagHelperOutput.Attributes);
181
Enumerable.Empty<
TagHelperAttribute
>()),
189
var
attribute = Assert.Single(tagHelperOutput.Attributes);
239
Enumerable.Empty<
TagHelperAttribute
>()),
247
var
attribute = Assert.Single(tagHelperOutput.Attributes);
295
Enumerable.Empty<
TagHelperAttribute
>()),
303
var
attribute = Assert.Single(tagHelperOutput.Attributes);
326
Enumerable.Empty<
TagHelperAttribute
>()),
334
var
attribute = Assert.Single(tagHelperOutput.Attributes);
375
Enumerable.Empty<
TagHelperAttribute
>()),
421
Enumerable.Empty<
TagHelperAttribute
>()),
429
var
attribute = Assert.Single(tagHelperOutput.Attributes);
Microsoft.AspNetCore.Mvc.TagHelpers (21)
AttributeMatcher.cs (1)
62
if (!allAttributes.TryGetAttribute(requiredAttributes[i], out
var
attribute))
FormTagHelper.cs (1)
169
if (output.Attributes.TryGetAttribute(HtmlActionAttributeName, out
var
actionAttribute))
InputTagHelper.cs (1)
345
if (output.Attributes.TryGetAttribute("form", out
var
formAttribute))
LinkTagHelper.cs (4)
281
var
existingAttribute = output.Attributes[index];
379
var
attribute = attributes[i];
405
if (!attributes.TryGetAttribute(RelAttributeName, out
var
relAttribute) ||
499
var
attribute = attributes[i];
ScriptTagHelper.cs (5)
294
var
existingAttribute = output.Attributes[index];
376
var
attribute = attributes[i];
441
var
attribute = new TagHelperAttribute(srcName, srcValue, valueStyle);
454
var
attribute = new TagHelperAttribute(srcName, srcValue, valueStyle);
490
var
attribute = attributes[i];
TagHelperOutputExtensions.cs (9)
98
var found = tagHelperOutput.Attributes.TryGetAttribute("class", out
var
classAttribute);
101
var
newAttribute = new TagHelperAttribute(
119
IEnumerable<
TagHelperAttribute
> attributes)
124
foreach (
var
attribute in attributes.ToArray())
156
if (!tagHelperOutput.Attributes.TryGetAttribute("class", out
TagHelperAttribute
classAttribute))
180
var
newClassAttribute = new TagHelperAttribute(
210
if (!tagHelperOutput.Attributes.TryGetAttribute("class", out
TagHelperAttribute
classAttribute))
258
TagHelperAttribute
classAttribute,
291
var
existingAttribute = allAttributes[allAttributeIndex];
Microsoft.AspNetCore.Mvc.TagHelpers.Test (125)
AnchorTagHelperTest.cs (12)
79
var
attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("id"));
94
Enumerable.Empty<
TagHelperAttribute
>()),
144
Enumerable.Empty<
TagHelperAttribute
>()),
196
Enumerable.Empty<
TagHelperAttribute
>()),
254
Enumerable.Empty<
TagHelperAttribute
>()),
313
Enumerable.Empty<
TagHelperAttribute
>()),
371
Enumerable.Empty<
TagHelperAttribute
>()),
422
Enumerable.Empty<
TagHelperAttribute
>()),
519
Enumerable.Empty<
TagHelperAttribute
>()),
559
Enumerable.Empty<
TagHelperAttribute
>()),
597
Enumerable.Empty<
TagHelperAttribute
>()),
635
Enumerable.Empty<
TagHelperAttribute
>()),
FormActionTagHelperTest.cs (9)
248
var
attribute = Assert.Single(output.Attributes);
306
var
attribute = Assert.Single(output.Attributes);
379
var
attribute = Assert.Single(output.Attributes);
432
var
attribute = Assert.Single(output.Attributes);
542
Enumerable.Empty<
TagHelperAttribute
>()),
582
Enumerable.Empty<
TagHelperAttribute
>()),
620
Enumerable.Empty<
TagHelperAttribute
>()),
658
Enumerable.Empty<
TagHelperAttribute
>()),
696
Enumerable.Empty<
TagHelperAttribute
>()),
FormTagHelperTest.cs (24)
115
var
attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("method"));
169
var
attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("method"));
227
var
attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("action"));
285
var
attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("action"));
357
var
attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("id"));
383
var
expectedAttribute = new TagHelperAttribute("method", method.ToString().ToLowerInvariant());
425
var
attribute = Assert.Single(output.Attributes);
440
Enumerable.Empty<
TagHelperAttribute
>()),
443
var
expectedAttribute = new TagHelperAttribute("asp-ROUTEE-NotRoute", "something");
496
var
attribute = Assert.Single(output.Attributes);
512
Enumerable.Empty<
TagHelperAttribute
>()),
619
var
attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("action"));
631
Enumerable.Empty<
TagHelperAttribute
>()),
688
Enumerable.Empty<
TagHelperAttribute
>()),
745
Enumerable.Empty<
TagHelperAttribute
>()),
803
Enumerable.Empty<
TagHelperAttribute
>()),
858
Enumerable.Empty<
TagHelperAttribute
>()),
904
Enumerable.Empty<
TagHelperAttribute
>()),
989
Enumerable.Empty<
TagHelperAttribute
>()),
999
var
attribute = Assert.Single(output.Attributes);
1039
Enumerable.Empty<
TagHelperAttribute
>()),
1075
Enumerable.Empty<
TagHelperAttribute
>()),
1109
Enumerable.Empty<
TagHelperAttribute
>()),
1143
Enumerable.Empty<
TagHelperAttribute
>()),
ImageTagHelperTest.cs (6)
124
var
expectedAttribute = expectedOutput.Attributes[i];
125
var
actualAttribute = output.Attributes[i];
160
var
srcAttribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("src"));
212
var
srcAttribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("src"));
255
var
srcAttribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("src"));
287
var
srcAttribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("src"));
InputTagHelperTest.cs (13)
86
Enumerable.Empty<
TagHelperAttribute
>()),
134
Enumerable.Empty<
TagHelperAttribute
>()),
181
Enumerable.Empty<
TagHelperAttribute
>()),
225
Enumerable.Empty<
TagHelperAttribute
>()),
642
Enumerable.Empty<
TagHelperAttribute
>()),
1155
Enumerable.Empty<
TagHelperAttribute
>()),
1758
Enumerable.Empty<
TagHelperAttribute
>()),
1994
Enumerable.Empty<
TagHelperAttribute
>()),
2074
Enumerable.Empty<
TagHelperAttribute
>()),
2136
Enumerable.Empty<
TagHelperAttribute
>()),
2204
Enumerable.Empty<
TagHelperAttribute
>()),
2270
Enumerable.Empty<
TagHelperAttribute
>()),
2328
Enumerable.Empty<
TagHelperAttribute
>()),
OptionTagHelperTest.cs (1)
439
foreach (
var
attribute in output.Attributes)
SelectTagHelperTest.cs (7)
201
Enumerable.Empty<
TagHelperAttribute
>()),
291
Enumerable.Empty<
TagHelperAttribute
>()),
382
Enumerable.Empty<
TagHelperAttribute
>()),
471
Enumerable.Empty<
TagHelperAttribute
>()),
635
Enumerable.Empty<
TagHelperAttribute
>());
774
var
attribute = Assert.Single(output.Attributes);
823
var
attribute = Assert.Single(output.Attributes);
src\Shared\Razor\CaseSensitiveBoundAttributeComparer.cs (4)
11
internal sealed class CaseSensitiveTagHelperAttributeComparer : IEqualityComparer<
TagHelperAttribute
>
20
public bool Equals(
TagHelperAttribute
attributeX,
TagHelperAttribute
attributeY)
35
public int GetHashCode(
TagHelperAttribute
attribute)
TagHelperOutputExtensionsTest.cs (38)
15
public static TheoryData<string, TagHelperAttributeList, TagHelperAttributeList, IEnumerable<
TagHelperAttribute
>> CopyHtmlAttributeData_MaintainsOrder
24
IEnumerable<
TagHelperAttribute
>>
331
IEnumerable<
TagHelperAttribute
> expectedAttributes)
352
public static TheoryData<string, TagHelperAttributeList, IEnumerable<
TagHelperAttribute
>> CopyHtmlAttributeData_MultipleAttributesSameName
357
return new TheoryData<string, TagHelperAttributeList, IEnumerable<
TagHelperAttribute
>>
433
IEnumerable<
TagHelperAttribute
> expectedAttributes)
477
var
expectedAttribute = new TagHelperAttribute(attributeName, attributeValue);
483
var
attribute = Assert.Single(tagHelperOutput.Attributes);
504
var
expectedAttribute = new TagHelperAttribute(attributeName, "world2");
518
var
attribute = Assert.Single(tagHelperOutput.Attributes);
565
var
expectedAttribute = new TagHelperAttribute("type", "btn");
576
var
attribute = Assert.Single(tagHelperOutput.Attributes);
593
var
expectedAttribute = new TagHelperAttribute("type", "btn");
602
var
attribute = Assert.Single(tagHelperOutput.Attributes);
619
var
expectedAttribute = new TagHelperAttribute("type", "btn");
629
var
attribute = Assert.Single(tagHelperOutput.Attributes);
804
var
expectedAttribute = new TagHelperAttribute("type", "btn");
814
var
attribute = Assert.Single(tagHelperOutput.Attributes);
832
var
expectedAttribute = new TagHelperAttribute("class", "Hello btn");
838
var
attribute = Assert.Single(tagHelperOutput.Attributes);
864
var
attribute = Assert.Single(tagHelperOutput.Attributes);
882
var
expectedAttribute = new TagHelperAttribute("visible", "val < 3");
889
var
attribute = Assert.Single(tagHelperOutput.Attributes);
904
var
expectedAttribute1 = new TagHelperAttribute("class", "btn");
905
var
expectedAttribute2 = new TagHelperAttribute("class2", "btn");
914
var
attribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.Name.Equals("class"));
929
var
expectedAttribute = new TagHelperAttribute("class", "btn");
938
var
attribute = Assert.Single(tagHelperOutput.Attributes);
951
var
expectedOutputAttribute = new TagHelperAttribute("class", "btn");
955
var
expectedBuilderAttribute = new TagHelperAttribute("for", "hello");
963
var
attribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.Name.Equals("class"));
986
var
classAttribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.Name.Equals("class"));
1008
var
classAttribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.Name.Equals("class"));
1034
var
classAttribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.Name.Equals("class"));
1077
var
classAttribute = tagHelperOutput.Attributes["class"];
1100
var
classAttribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.Name.Equals("class"));
1121
var
classAttribute = tagHelperOutput.Attributes["class"];
1144
var
classAttribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.Name.Equals("class"));
TextAreaTagHelperTest.cs (2)
123
Enumerable.Empty<
TagHelperAttribute
>()),
230
var
attribute = Assert.Single(output.Attributes);
ValidationMessageTagHelperTest.cs (8)
74
var
attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("id"));
228
var
attribute = Assert.Single(output.Attributes);
261
Enumerable.Empty<
TagHelperAttribute
>()),
334
Enumerable.Empty<
TagHelperAttribute
>()),
347
var
attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("data-foo"));
396
Enumerable.Empty<
TagHelperAttribute
>()),
409
var
attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("data-foo"));
437
Enumerable.Empty<
TagHelperAttribute
>()),
ValidationSummaryTagHelperTest.cs (1)
255
var
attribute = Assert.Single(output.Attributes, attr => attr.Name.Equals("class"));
Microsoft.AspNetCore.Razor (95)
TagHelpers\ReadOnlyTagHelperAttributeList.cs (48)
9
/// A read-only collection of <see cref="
TagHelperAttribute
"/>s.
11
public abstract class ReadOnlyTagHelperAttributeList : ReadOnlyCollection<
TagHelperAttribute
>
18
: base(new List<
TagHelperAttribute
>())
27
public ReadOnlyTagHelperAttributeList(IList<
TagHelperAttribute
> attributes)
33
/// Gets the first <see cref="
TagHelperAttribute
"/> with <see cref="
TagHelperAttribute
.Name"/>
37
/// The <see cref="
TagHelperAttribute
.Name"/> of the <see cref="
TagHelperAttribute
"/> to get.
39
/// <returns>The first <see cref="
TagHelperAttribute
"/> with <see cref="
TagHelperAttribute
.Name"/>
43
public
TagHelperAttribute
this[string name]
55
var
attribute = items[i];
67
/// Determines whether a <see cref="
TagHelperAttribute
"/> with <see cref="
TagHelperAttribute
.Name"/>
70
/// <param name="name">The <see cref="
TagHelperAttribute
.Name"/> of the
71
/// <see cref="
TagHelperAttribute
"/> to get.</param>
73
/// <c>true</c> if a <see cref="
TagHelperAttribute
"/> with the same
74
/// <see cref="
TagHelperAttribute
.Name"/> exists in the collection; otherwise, <c>false</c>.
83
/// Retrieves the first <see cref="
TagHelperAttribute
"/> with <see cref="
TagHelperAttribute
.Name"/>
86
/// <param name="name">The <see cref="
TagHelperAttribute
.Name"/> of the
87
/// <see cref="
TagHelperAttribute
"/> to get.</param>
88
/// <param name="attribute">When this method returns, the first <see cref="
TagHelperAttribute
"/> with
89
/// <see cref="
TagHelperAttribute
.Name"/> matching <paramref name="name"/>, if found; otherwise,
91
/// <returns><c>true</c> if a <see cref="
TagHelperAttribute
"/> with the same
92
/// <see cref="
TagHelperAttribute
.Name"/> exists in the collection; otherwise, <c>false</c>.</returns>
94
public bool TryGetAttribute(string name, out
TagHelperAttribute
attribute)
104
/// Retrieves <see cref="
TagHelperAttribute
"/>s in the collection with
105
/// <see cref="
TagHelperAttribute
.Name"/> matching <paramref name="name"/>.
107
/// <param name="name">The <see cref="
TagHelperAttribute
.Name"/> of the
108
/// <see cref="
TagHelperAttribute
"/>s to get.</param>
109
/// <param name="attributes">When this method returns, the <see cref="
TagHelperAttribute
"/>s with
110
/// <see cref="
TagHelperAttribute
.Name"/> matching <paramref name="name"/>.</param>
111
/// <returns><c>true</c> if at least one <see cref="
TagHelperAttribute
"/> with the same
112
/// <see cref="
TagHelperAttribute
.Name"/> exists in the collection; otherwise, <c>false</c>.</returns>
114
public bool TryGetAttributes(string name, out IReadOnlyList<
TagHelperAttribute
> attributes)
119
List<
TagHelperAttribute
> matchedAttributes = null;
125
var
attribute = items[i];
130
matchedAttributes = new List<
TagHelperAttribute
>();
136
attributes = matchedAttributes ?? (IReadOnlyList<
TagHelperAttribute
>)Array.Empty<
TagHelperAttribute
>();
142
/// Searches for a <see cref="
TagHelperAttribute
"/> who's <see cref="
TagHelperAttribute
.Name"/>
146
/// <param name="name">The <see cref="
TagHelperAttribute
.Name"/> to locate in the collection.</param>
147
/// <returns>The zero-based index of the first matching <see cref="
TagHelperAttribute
"/> within the collection,
171
/// <see cref="
TagHelperAttribute
.Name"/>.</param>
174
/// <see cref="
TagHelperAttribute
.Name"/>.</returns>
175
protected static bool NameEquals(string name,
TagHelperAttribute
attribute)
TagHelpers\TagHelperAttribute.cs (6)
15
/// Instantiates a new instance of <see cref="
TagHelperAttribute
"/> with the specified <paramref name="name"/>.
26
/// Instantiates a new instance of <see cref="
TagHelperAttribute
"/> with the specified <paramref name="name"/>
37
/// Instantiates a new instance of <see cref="
TagHelperAttribute
"/> with the specified <paramref name="name"/>,
71
public bool Equals(
TagHelperAttribute
other)
209
var
other = obj as
TagHelperAttribute
;
TagHelpers\TagHelperAttributeList.cs (38)
7
/// A collection of <see cref="
TagHelperAttribute
"/>s.
9
public class TagHelperAttributeList : ReadOnlyTagHelperAttributeList, IList<
TagHelperAttribute
>
24
public TagHelperAttributeList(IEnumerable<
TagHelperAttribute
> attributes)
25
: base(new List<
TagHelperAttribute
>(attributes))
35
public TagHelperAttributeList(List<
TagHelperAttribute
> attributes)
43
/// <paramref name="value"/>'s <see cref="
TagHelperAttribute
.Name"/> must not be <c>null</c>.
45
public new
TagHelperAttribute
this[int index]
60
/// Replaces the first <see cref="
TagHelperAttribute
"/> with <see cref="
TagHelperAttribute
.Name"/> matching
61
/// <paramref name="name"/> and removes any additional matching <see cref="
TagHelperAttribute
"/>s. If a
62
/// matching <see cref="
TagHelperAttribute
"/> is not found, adds a <see cref="
TagHelperAttribute
"/> with
65
/// The <see cref="
TagHelperAttribute
.Name"/> of the <see cref="
TagHelperAttribute
"/> to set.
68
/// The <see cref="
TagHelperAttribute
.Value"/> to set.
73
var
attribute = new TagHelperAttribute(name, value);
78
/// Replaces the first <see cref="
TagHelperAttribute
"/> with <see cref="
TagHelperAttribute
.Name"/> matching
79
/// <paramref name="attribute"/>'s <see cref="
TagHelperAttribute
.Name"/> and removes any additional matching
80
/// <see cref="
TagHelperAttribute
"/>s. If a matching <see cref="
TagHelperAttribute
"/> is not found, adds the
84
/// The <see cref="
TagHelperAttribute
"/> to set.
86
/// <remarks><paramref name="attribute"/>'s <see cref="
TagHelperAttribute
.Name"/> is compared
88
public void SetAttribute(
TagHelperAttribute
attribute)
121
bool ICollection<
TagHelperAttribute
>.IsReadOnly => false;
124
/// Adds a <see cref="
TagHelperAttribute
"/> to the end of the collection with the specified
127
/// <param name="name">The <see cref="
TagHelperAttribute
.Name"/> of the attribute to add.</param>
128
/// <param name="value">The <see cref="
TagHelperAttribute
.Value"/> of the attribute to add.</param>
131
var
attribute = new TagHelperAttribute(name, value);
136
public void Add(
TagHelperAttribute
attribute)
144
public void Insert(int index,
TagHelperAttribute
attribute)
153
/// <paramref name="attribute"/>s <see cref="
TagHelperAttribute
.Name"/> is compared case-insensitively.
155
public bool Remove(
TagHelperAttribute
attribute)
169
/// Removes all <see cref="
TagHelperAttribute
"/>s with <see cref="
TagHelperAttribute
.Name"/> matching
173
/// The <see cref="
TagHelperAttribute
.Name"/> of <see cref="
TagHelperAttribute
"/>s to remove.
176
/// <c>true</c> if at least 1 <see cref="
TagHelperAttribute
"/> was removed; otherwise, <c>false</c>.
TagHelpers\TagHelperOutput.cs (3)
296
var
attribute = Attributes[i];
345
var
attribute = Attributes[i];
400
var
attribute = Attributes[i];
Microsoft.AspNetCore.Razor.Runtime (6)
Properties\AssemblyInfo.cs (1)
18
[assembly: TypeForwardedTo(typeof(
TagHelperAttribute
))]
Runtime\TagHelpers\TagHelperExecutionContext.cs (5)
127
var
attribute = new TagHelperAttribute(name, value, valueStyle);
134
/// <param name="attribute">The <see cref="
TagHelperAttribute
"/> to track.</param>
135
public void AddHtmlAttribute(
TagHelperAttribute
attribute)
153
var
attribute = new TagHelperAttribute(name, value, valueStyle);
161
public void AddTagHelperAttribute(
TagHelperAttribute
attribute)
Microsoft.AspNetCore.Razor.Runtime.Test (6)
Runtime\TagHelpers\TagHelperExecutionContextTest.cs (2)
132
var
attribute = Assert.Single(output.Attributes);
182
var
attribute = Assert.Single(context.AllAttributes);
src\Shared\Razor\CaseSensitiveBoundAttributeComparer.cs (4)
11
internal sealed class CaseSensitiveTagHelperAttributeComparer : IEqualityComparer<
TagHelperAttribute
>
20
public bool Equals(
TagHelperAttribute
attributeX,
TagHelperAttribute
attributeY)
35
public int GetHashCode(
TagHelperAttribute
attribute)
Microsoft.AspNetCore.Razor.Test (236)
src\Shared\Razor\CaseSensitiveBoundAttributeComparer.cs (4)
11
internal sealed class CaseSensitiveTagHelperAttributeComparer : IEqualityComparer<
TagHelperAttribute
>
20
public bool Equals(
TagHelperAttribute
attributeX,
TagHelperAttribute
attributeY)
35
public int GetHashCode(
TagHelperAttribute
attribute)
TagHelpers\ReadOnlyTagHelperAttributeListTest.cs (105)
10
public static TheoryData<IEnumerable<
TagHelperAttribute
>, string, int> IndexOfNameData
14
var
first = new TagHelperAttribute("First", "First Value");
15
var
second = new TagHelperAttribute("Second", "Second Value");
16
var
third = new TagHelperAttribute("Third", "Third Value");
19
IEnumerable<
TagHelperAttribute
>, // initialAttributes
40
IEnumerable<
TagHelperAttribute
> initialAttributes,
54
public static TheoryData<IEnumerable<
TagHelperAttribute
>, int,
TagHelperAttribute
> IntIndexerData
58
var
first = new TagHelperAttribute("First", "First Value");
59
var
second = new TagHelperAttribute("Second", "Second Value");
60
var
third = new TagHelperAttribute("Third", "Third Value");
63
IEnumerable<
TagHelperAttribute
>, // initialAttributes
65
TagHelperAttribute
> // expectedAttribute
80
IEnumerable<
TagHelperAttribute
> initialAttributes,
82
TagHelperAttribute
expectedAttribute)
88
var
attribute = attributes[indexToLookup];
118
public static TheoryData<IEnumerable<
TagHelperAttribute
>, string,
TagHelperAttribute
> StringIndexerData
122
var
A = new TagHelperAttribute("AName", "AName Value");
123
var
A2 = new TagHelperAttribute("aname", "AName Second Value");
124
var
A3 = new TagHelperAttribute("AName", "AName Third Value");
125
var
B = new TagHelperAttribute("BName", "BName Value");
126
var
C = new TagHelperAttribute("CName", "CName Value");
129
IEnumerable<
TagHelperAttribute
>, // initialAttributes
131
TagHelperAttribute
> // expectedAttribute
172
IEnumerable<
TagHelperAttribute
> initialAttributes,
174
TagHelperAttribute
expectedAttribute)
180
var
attribute = attributes[nameToLookup];
205
public static TheoryData<IEnumerable<
TagHelperAttribute
>,
TagHelperAttribute
, bool> ContainsData
209
var
A = new TagHelperAttribute("AName", "AName Value");
210
var
A2 = new TagHelperAttribute("aname", "AName Second Value");
211
var
A3 = new TagHelperAttribute("AName", "AName Third Value");
212
var
B = new TagHelperAttribute("BName", "BName Value");
213
var
C = new TagHelperAttribute("CName", "CName Value");
216
IEnumerable<
TagHelperAttribute
>, // initialAttributes
217
TagHelperAttribute
, // attributeToLookup
299
IEnumerable<
TagHelperAttribute
> initialAttributes,
300
TagHelperAttribute
attributeToLookup,
313
public static TheoryData<IEnumerable<
TagHelperAttribute
>, string, bool> ContainsNameData
317
var
A = new TagHelperAttribute("AName", "AName Value");
318
var
A2 = new TagHelperAttribute("aname", "AName Second Value");
319
var
A3 = new TagHelperAttribute("AName", "AName Third Value");
320
var
B = new TagHelperAttribute("BName", "BName Value");
321
var
C = new TagHelperAttribute("CName", "CName Value");
324
IEnumerable<
TagHelperAttribute
>, // initialAttributes
375
IEnumerable<
TagHelperAttribute
> initialAttributes,
389
public static TheoryData<IEnumerable<
TagHelperAttribute
>,
TagHelperAttribute
, int> IndexOfData
393
var
A = new TagHelperAttribute("AName", "AName Value");
394
var
A2 = new TagHelperAttribute("aname", "AName Second Value");
395
var
A3 = new TagHelperAttribute("AName", "AName Third Value");
396
var
B = new TagHelperAttribute("BName", "BName Value");
397
var
C = new TagHelperAttribute("CName", "CName Value");
400
IEnumerable<
TagHelperAttribute
>, // initialAttributes
401
TagHelperAttribute
, // attributeToLookup
483
IEnumerable<
TagHelperAttribute
> initialAttributes,
484
TagHelperAttribute
attributeToLookup,
497
public static TheoryData<IEnumerable<
TagHelperAttribute
>, string,
TagHelperAttribute
, bool> TryGetAttributeData
501
var
A = new TagHelperAttribute("AName", "AName Value");
502
var
A2 = new TagHelperAttribute("aname", "AName Second Value");
503
var
A3 = new TagHelperAttribute("AName", "AName Third Value");
504
var
B = new TagHelperAttribute("BName", "BName Value");
505
var
C = new TagHelperAttribute("CName", "CName Value");
508
IEnumerable<
TagHelperAttribute
>, // initialAttributes
510
TagHelperAttribute
, // expectedAttribute
552
IEnumerable<
TagHelperAttribute
> initialAttributes,
554
TagHelperAttribute
expectedAttribute,
559
TagHelperAttribute
attribute;
569
public static TheoryData<IEnumerable<
TagHelperAttribute
>, string, IEnumerable<
TagHelperAttribute
>, bool> TryGetAttributesData
573
var
A = new TagHelperAttribute("AName", "AName Value");
574
var
A2 = new TagHelperAttribute("aname", "AName Second Value");
575
var
A3 = new TagHelperAttribute("AName", "AName Third Value");
576
var
B = new TagHelperAttribute("BName", "BName Value");
577
var
C = new TagHelperAttribute("CName", "CName Value");
580
IEnumerable<
TagHelperAttribute
>, // initialAttributes
582
IEnumerable<
TagHelperAttribute
>, // expectedAttributes
607
{ new[] { A }, "_AName_", Enumerable.Empty<
TagHelperAttribute
>(), false },
608
{ new[] { A }, "completely different", Enumerable.Empty<
TagHelperAttribute
>(), false },
609
{ new[] { A, B }, "_AName_", Enumerable.Empty<
TagHelperAttribute
>(), false },
610
{ new[] { A, B }, "completely different", Enumerable.Empty<
TagHelperAttribute
>(), false },
611
{ new[] { A, B, C }, "_BName_", Enumerable.Empty<
TagHelperAttribute
>(), false },
612
{ new[] { A, B, C }, "way different", Enumerable.Empty<
TagHelperAttribute
>(), false },
613
{ new[] { A, A2, B, C }, "_cnamE_", Enumerable.Empty<
TagHelperAttribute
>(), false },
614
{ new[] { A, A2, B, C }, "way different", Enumerable.Empty<
TagHelperAttribute
>(), false },
615
{ new[] { A, A2, A3, B, C }, "_cnamE_", Enumerable.Empty<
TagHelperAttribute
>(), false },
616
{ new[] { A, A2, A3, B, C }, "different", Enumerable.Empty<
TagHelperAttribute
>(), false },
624
IEnumerable<
TagHelperAttribute
> initialAttributes,
626
IEnumerable<
TagHelperAttribute
> expectedAttributes,
631
IReadOnlyList<
TagHelperAttribute
> resolvedAttributes;
676
var attributes = new TestableReadOnlyTagHelperAttributes(Enumerable.Empty<
TagHelperAttribute
>());
693
IEnumerable<
TagHelperAttribute
> initialAttributes,
695
TagHelperAttribute
expectedAttribute)
698
var attributes = new TestableReadOnlyTagHelperAttributes(Enumerable.Empty<
TagHelperAttribute
>());
702
var
attribute = attributes[indexToLookup];
711
IEnumerable<
TagHelperAttribute
> initialAttributes,
713
TagHelperAttribute
expectedAttribute)
716
var attributes = new TestableReadOnlyTagHelperAttributes(Enumerable.Empty<
TagHelperAttribute
>());
720
var
attribute = attributes[nameToLookup];
728
public TestableReadOnlyTagHelperAttributes(IEnumerable<
TagHelperAttribute
> attributes)
729
: base(new List<
TagHelperAttribute
>(attributes))
733
public List<
TagHelperAttribute
> PublicAttributes
737
return (List<
TagHelperAttribute
>)Items;
TagHelpers\TagHelperAttributeListTest.cs (126)
15
IEnumerable<
TagHelperAttribute
> initialAttributes,
17
TagHelperAttribute
expectedAttribute)
23
var
attribute = attributes[indexToLookup];
29
public static TheoryData<IEnumerable<
TagHelperAttribute
>, int,
TagHelperAttribute
, IEnumerable<
TagHelperAttribute
>> IntIndexerSetData
33
var
first = new TagHelperAttribute("First", "First Value");
34
var
second = new TagHelperAttribute("Second", "Second Value");
35
var
third = new TagHelperAttribute("Third", "Third Value");
36
var
set = new TagHelperAttribute("Set", "Set Value");
39
IEnumerable<
TagHelperAttribute
>, // initialAttributes
41
TagHelperAttribute
, // setValue
42
IEnumerable<
TagHelperAttribute
>> // expectedAttributes
57
IEnumerable<
TagHelperAttribute
> initialAttributes,
59
TagHelperAttribute
setValue,
60
IEnumerable<
TagHelperAttribute
> expectedAttributes)
114
IEnumerable<
TagHelperAttribute
> initialAttributes,
116
TagHelperAttribute
expectedAttribute)
122
var
attribute = attributes[nameToLookup];
128
public static TheoryData<IEnumerable<
TagHelperAttribute
>, string, object, IEnumerable<
TagHelperAttribute
>> StringIndexerSetData
132
var
A = new TagHelperAttribute("AName", "AName Value");
133
var
ASet1 = new TagHelperAttribute("AName", "AName Set Value");
134
var
ASet2 = new TagHelperAttribute("AnAmE", "AName Set Value");
135
var
A2 = new TagHelperAttribute("aname", "AName Second Value");
136
var
A3 = new TagHelperAttribute("AName", "AName Third Value");
137
var
A3Set = new TagHelperAttribute("aname", "AName Third Set Value");
138
var
B = new TagHelperAttribute("BName", "BName Value");
139
var
BSet1 = new TagHelperAttribute("BName", "BName Set Value");
140
var
BSet2 = new TagHelperAttribute("BnAmE", "BName Set Value");
141
var
C = new TagHelperAttribute("CName", "CName Value");
142
var
CSet1 = new TagHelperAttribute("CName", "CName Set Value");
143
var
CSet2 = new TagHelperAttribute("cnamE", "CName Set Value");
144
var
set = new TagHelperAttribute("Set", "Set Value");
147
IEnumerable<
TagHelperAttribute
>, // initialAttributes
150
IEnumerable<
TagHelperAttribute
>> // expectedAttributes
162
{ Enumerable.Empty<
TagHelperAttribute
>(), "Set", set.Value, new[] { set } },
183
IEnumerable<
TagHelperAttribute
> initialAttributes,
186
IEnumerable<
TagHelperAttribute
> expectedAttributes)
219
var attributes = new TagHelperAttributeList() as ICollection<
TagHelperAttribute
>;
228
public static TheoryData<IEnumerable<
TagHelperAttribute
>,
TagHelperAttribute
, IEnumerable<
TagHelperAttribute
>> AddData
232
var
A = new TagHelperAttribute("AName", "AName Value");
233
var
A2 = new TagHelperAttribute("aname", "AName Second Value");
234
var
B = new TagHelperAttribute("BName", "BName Value");
237
IEnumerable<
TagHelperAttribute
>, // initialAttributes
238
TagHelperAttribute
, // attributeToAdd
239
IEnumerable<
TagHelperAttribute
>> // expectedAttributes
241
{ Enumerable.Empty<
TagHelperAttribute
>(), A, new[] { A } },
251
IEnumerable<
TagHelperAttribute
> initialAttributes,
252
TagHelperAttribute
attributeToAdd,
253
IEnumerable<
TagHelperAttribute
> expectedAttributes)
265
public static TheoryData<IEnumerable<
TagHelperAttribute
>,
TagHelperAttribute
, int, IEnumerable<
TagHelperAttribute
>> InsertData
269
var
A = new TagHelperAttribute("AName", "AName Value");
270
var
A2 = new TagHelperAttribute("aname", "AName Second Value");
271
var
B = new TagHelperAttribute("BName", "BName Value");
274
IEnumerable<
TagHelperAttribute
>, // initialAttributes
275
TagHelperAttribute
, // attributeToAdd
277
IEnumerable<
TagHelperAttribute
>> // expectedAttributes
279
{ Enumerable.Empty<
TagHelperAttribute
>(), A, 0, new[] { A } },
294
IEnumerable<
TagHelperAttribute
> initialAttributes,
295
TagHelperAttribute
attributeToAdd,
297
IEnumerable<
TagHelperAttribute
> expectedAttributes)
325
public static TheoryData<IEnumerable<
TagHelperAttribute
>,
TagHelperAttribute
[], int, IEnumerable<
TagHelperAttribute
>> CopyToData
329
var
A = new TagHelperAttribute("AName", "AName Value");
330
var
A2 = new TagHelperAttribute("aname", "AName Second Value");
331
var
B = new TagHelperAttribute("BName", "BName Value");
334
IEnumerable<
TagHelperAttribute
>, // initialAttributes
335
TagHelperAttribute
[], // attributesToCopy
337
IEnumerable<
TagHelperAttribute
>> // expectedAttributes
339
{ Enumerable.Empty<
TagHelperAttribute
>(), new[] { A }, 0, new[] { A } },
340
{ Enumerable.Empty<
TagHelperAttribute
>(), new[] { A, B }, 0, new[] { A, B } },
358
IEnumerable<
TagHelperAttribute
> initialAttributes,
359
TagHelperAttribute
[] attributesToCopy,
361
IEnumerable<
TagHelperAttribute
> expectedAttributes)
365
var attributeDestination = new
TagHelperAttribute
[expectedAttributes.Count()];
375
public static TheoryData<IEnumerable<
TagHelperAttribute
>, string, IEnumerable<
TagHelperAttribute
>, bool> RemoveAllData
379
var
A = new TagHelperAttribute("AName", "AName Value");
380
var
A2 = new TagHelperAttribute("aname", "AName Second Value");
381
var
A3 = new TagHelperAttribute("AName", "AName Third Value");
382
var
B = new TagHelperAttribute("BName", "BName Value");
383
var
C = new TagHelperAttribute("CName", "CName Value");
386
IEnumerable<
TagHelperAttribute
>, // initialAttributes
388
IEnumerable<
TagHelperAttribute
>, // expectedAttributes
391
{ new[] { A }, "AName", Enumerable.Empty<
TagHelperAttribute
>(), true },
392
{ new[] { A }, "AnAmE", Enumerable.Empty<
TagHelperAttribute
>(), true },
407
{ new[] { A, A3 }, "AName", Enumerable.Empty<
TagHelperAttribute
>(), true },
408
{ new[] { A3, A }, "aname", Enumerable.Empty<
TagHelperAttribute
>(), true },
409
{ new[] { A, A2, A3 }, "AName", Enumerable.Empty<
TagHelperAttribute
>(), true },
413
{ Enumerable.Empty<
TagHelperAttribute
>(), "_0_", Enumerable.Empty<
TagHelperAttribute
>(), false },
431
IEnumerable<
TagHelperAttribute
> initialAttributes,
433
IEnumerable<
TagHelperAttribute
> expectedAttributes,
447
public static TheoryData<IEnumerable<
TagHelperAttribute
>,
TagHelperAttribute
, IEnumerable<
TagHelperAttribute
>, bool> RemoveData
451
var
A = new TagHelperAttribute("AName", "av");
452
var
A2 = new TagHelperAttribute("aname", "av");
453
var
A3 = new TagHelperAttribute("AName", "av");
454
var
B = new TagHelperAttribute("BName", "bv");
455
var
C = new TagHelperAttribute("CName", "cv");
456
var empty = Enumerable.Empty<
TagHelperAttribute
>();
459
IEnumerable<
TagHelperAttribute
>, // initialAttributes
460
TagHelperAttribute
, // attributeToRemove
461
IEnumerable<
TagHelperAttribute
>, // expectedAttributes
486
{ Enumerable.Empty<
TagHelperAttribute
>(), new TagHelperAttribute("DoesNotExist", "_0_"), Enumerable.Empty<
TagHelperAttribute
>(), false },
504
IEnumerable<
TagHelperAttribute
> initialAttributes,
505
TagHelperAttribute
attributeToRemove,
506
IEnumerable<
TagHelperAttribute
> expectedAttributes,
520
public static TheoryData<IEnumerable<
TagHelperAttribute
>, int, IEnumerable<
TagHelperAttribute
>> RemoveAtData
524
var
A = new TagHelperAttribute("AName", "AName Value");
525
var
A2 = new TagHelperAttribute("aname", "AName Second Value");
526
var
B = new TagHelperAttribute("BName", "BName Value");
529
IEnumerable<
TagHelperAttribute
>, // initialAttributes
531
IEnumerable<
TagHelperAttribute
>> // expectedAttributes
533
{ new[] { A }, 0, Enumerable.Empty<
TagHelperAttribute
>() },
548
IEnumerable<
TagHelperAttribute
> initialAttributes,
550
IEnumerable<
TagHelperAttribute
> expectedAttributes)
TagHelpers\TagHelperOutputTest.cs (1)
395
var
attribute = Assert.Single(tagHelperOutput.Attributes);