Align `TagHelperOutputExtensionsTest.CaseSensitiveTagHelperAttributeComparer` with Razor.Runtime version
- was missing `Minimized` comparison
This commit is contained in:
parent
7120b2ff92
commit
260ac2939e
|
|
@ -607,15 +607,18 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(
|
public bool Equals(IReadOnlyTagHelperAttribute attributeX, IReadOnlyTagHelperAttribute attributeY)
|
||||||
IReadOnlyTagHelperAttribute attributeX,
|
|
||||||
IReadOnlyTagHelperAttribute attributeY)
|
|
||||||
{
|
{
|
||||||
return
|
if (attributeX == attributeY)
|
||||||
attributeX == attributeY ||
|
{
|
||||||
// Normal comparer doesn't care about the Name case, in tests we do.
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Normal comparer (TagHelperAttribute.Equals()) doesn't care about the Name case, in tests we do.
|
||||||
|
return attributeX != null &&
|
||||||
string.Equals(attributeX.Name, attributeY.Name, StringComparison.Ordinal) &&
|
string.Equals(attributeX.Name, attributeY.Name, StringComparison.Ordinal) &&
|
||||||
Equals(attributeX.Value, attributeY.Value);
|
attributeX.Minimized == attributeY.Minimized &&
|
||||||
|
(attributeX.Minimized || Equals(attributeX.Value, attributeY.Value));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetHashCode(IReadOnlyTagHelperAttribute attribute)
|
public int GetHashCode(IReadOnlyTagHelperAttribute attribute)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue