Skip to content

Commit 8d7392b

Browse files
committed
Fix tag reflection test error
1 parent afc903e commit 8d7392b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ProgressOnderwijsUtils/Html/TagDescription.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static Dictionary<string, string> AttributeLookup(Type tagType, IHtmlElement emp
3434
.Where(
3535
mi => {
3636
var typeArgument = mi.GetGenericArguments().Single();
37-
return typeArgument.GetGenericParameterConstraints()
37+
return mi.GetParameters().Length == 2 && typeArgument.GetGenericParameterConstraints()
3838
.All(
3939
constraint =>
4040
constraint.IsAssignableFrom(tagType)
@@ -43,7 +43,7 @@ static Dictionary<string, string> AttributeLookup(Type tagType, IHtmlElement emp
4343
}
4444
)
4545
.ToDictionary(
46-
method => ((IHtmlElement)method.MakeGenericMethod(tagType).Invoke(null, [emptyValue, "",]).AssertNotNull()).Attributes[^1].Name,
46+
method => ((IHtmlElement)method.MakeGenericMethod(tagType).Invoke(null, [emptyValue, method.GetParameters()[1].ParameterType == typeof(string) ? "" : true,]).AssertNotNull()).Attributes[^1].Name,
4747
method => method.Name,
4848
StringComparer.OrdinalIgnoreCase
4949
);

0 commit comments

Comments
 (0)