public void AddsAttributeCorrectly() { string characterSet = "CharacterSet"; HtmlAttributeBuilder builder = new HtmlAttributeBuilder(); var result = builder.AddAcceptCharsets( characterSet ); Assert.AreSame( builder, result ); AttributeValueCollection attributeValues = builder.Attributes[ HtmlAttributes.AcceptCharset ] as AttributeValueCollection; Assert.IsNotNull( attributeValues ); Assert.AreEqual( characterSet, attributeValues[ 0 ] ); }
public void WithMultipleClassesAddsAttributeCorrectly() { string[] characterSets = new string[] { "CharacterSet1", "CharacterSet2" }; HtmlAttributeBuilder builder = new HtmlAttributeBuilder(); var result = builder.AddAcceptCharsets( characterSets ); Assert.AreSame( builder, result ); AttributeValueCollection attributeValues = builder.Attributes[ HtmlAttributes.AcceptCharset ] as AttributeValueCollection; Assert.IsNotNull( attributeValues ); CollectionAssert.AreEquivalent( characterSets, attributeValues ); }