public void AddsAttributeCorrectly() { string script = "Script"; var attributes = new AttributeCollection(); var builder = new EventAttributeBuilder( attributes ); var result = builder.OnSubmit( script ); Assert.AreSame( builder, result ); Assert.AreEqual( script, attributes[ HtmlAttributes.Events.OnSubmit ] ); }
public void WithNullNameDoesNotAddAttribute() { string name = null; string script = "Script"; var attributes = new AttributeCollection(); var builder = new EventAttributeBuilder( attributes ); var result = builder.Event( name, script ); Assert.AreSame( builder, result ); Assert.AreEqual( 0, attributes.Count ); }
public void WithWhiteSpaceNameDoesNotAddAttribute() { string name = " "; string script = "Script"; var attributes = new AttributeCollection(); var builder = new EventAttributeBuilder( attributes ); var result = builder.Event( name, script ); Assert.AreSame( builder, result ); Assert.IsFalse( attributes.ContainsKey( name ) ); }
public void AddsAttributeCorrectly() { string name = "Name"; string script = "Script"; var attributes = new AttributeCollection(); var builder = new EventAttributeBuilder( attributes ); var result = builder.Event( name, script ); Assert.AreSame( builder, result ); Assert.AreEqual( script, attributes[ name ] ); }