public void WithNullStyleAttributeExpressionReturnsCorrectly() { HtmlAttributeBuilder builder = new HtmlAttributeBuilder(); var result = builder.Styles( null ); Assert.AreSame( builder, result ); Assert.AreEqual( 0, builder.Attributes.Count ); }
public void AddsStyleAttributeCorrectly() { string name = "Name"; string value = "Value"; HtmlAttributeBuilder builder = new HtmlAttributeBuilder(); var result = builder.Styles( x => x.Style( name, value ) ); Assert.AreSame( builder, result ); StyleCollection styles = builder.Attributes[ HtmlAttributes.Style ] as StyleCollection; Assert.IsNotNull( styles ); Assert.AreEqual( value, styles[ name ] ); }