// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using Xunit; namespace Microsoft.AspNet.Mvc.Rendering { public class HtmlHelperTest { public static TheoryData> IgnoreCaseTestData { get { return new TheoryData> { { new { selected = true, SeLeCtEd = false }, new KeyValuePair("selected", false) }, { new { SeLeCtEd = false, selected = true }, new KeyValuePair("SeLeCtEd", true) }, { new { SelECTeD = false, SeLECTED = true }, new KeyValuePair("SelECTeD", true) } }; } } [Theory] [MemberData(nameof(IgnoreCaseTestData))] public void AnonymousObjectToHtmlAttributes_IgnoresPropertyCase(object htmlAttributeObject, KeyValuePair expectedEntry) { // Act var result = HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributeObject); // Assert var entry = Assert.Single(result); Assert.Equal(expectedEntry, entry); } } }