public void WithRegexValueAddsAttributeCorrectly()
        {
            Regex value = new Regex( "Regex" );

            HtmlAttributeBuilder builder = new HtmlAttributeBuilder();
            var result = builder.Pattern( value );

            Assert.AreSame( builder, result );
            Assert.AreEqual( value.ToString(), builder.Attributes[ HtmlAttributes.Pattern ] );
        }
        public void WithStringValueAddsAttributeCorrectly()
        {
            string value = "Value";

            HtmlAttributeBuilder builder = new HtmlAttributeBuilder();
            var result = builder.Pattern( value );

            Assert.AreSame( builder, result );
            Assert.AreEqual( value, builder.Attributes[ HtmlAttributes.Pattern ] );
        }
        public void WithNullRegexValueDoesNotAddAttribute()
        {
            Regex value = null;

            HtmlAttributeBuilder builder = new HtmlAttributeBuilder();
            var result = builder.Pattern( value );

            Assert.AreSame( builder, result );
            Assert.IsFalse( builder.Attributes.ContainsKey( HtmlAttributes.Pattern ) );
        }