From 260ac2939ec38778bda9e0c45496286240103d3b Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Wed, 29 Jul 2015 15:42:41 -0700 Subject: [PATCH] Align `TagHelperOutputExtensionsTest.CaseSensitiveTagHelperAttributeComparer` with Razor.Runtime version - was missing `Minimized` comparison --- .../TagHelperOutputExtensionsTest.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test/Microsoft.AspNet.Mvc.TagHelpers.Test/TagHelperOutputExtensionsTest.cs b/test/Microsoft.AspNet.Mvc.TagHelpers.Test/TagHelperOutputExtensionsTest.cs index 351567ccad..8391af2793 100644 --- a/test/Microsoft.AspNet.Mvc.TagHelpers.Test/TagHelperOutputExtensionsTest.cs +++ b/test/Microsoft.AspNet.Mvc.TagHelpers.Test/TagHelperOutputExtensionsTest.cs @@ -607,15 +607,18 @@ namespace Microsoft.AspNet.Mvc.TagHelpers { } - public bool Equals( - IReadOnlyTagHelperAttribute attributeX, - IReadOnlyTagHelperAttribute attributeY) + public bool Equals(IReadOnlyTagHelperAttribute attributeX, IReadOnlyTagHelperAttribute attributeY) { - return - attributeX == attributeY || - // Normal comparer doesn't care about the Name case, in tests we do. + if (attributeX == attributeY) + { + 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) && - Equals(attributeX.Value, attributeY.Value); + attributeX.Minimized == attributeY.Minimized && + (attributeX.Minimized || Equals(attributeX.Value, attributeY.Value)); } public int GetHashCode(IReadOnlyTagHelperAttribute attribute)