public void NullFalseAttributeExpressionWithConditionFalseReturnsCorrectly()
        {
            bool condition = false;

            HtmlAttributeBuilder builder = new HtmlAttributeBuilder();
            var result = builder.If( condition, null, null );

            Assert.AreSame( builder, result );
            Assert.IsTrue( builder.Attributes.Count == 0 );
        }
        public void ConditionTrueInvokesTrueAttributeExpression()
        {
            bool condition = true;
            string attributeName = "Name";
            string attributeValue = "Value";

            HtmlAttributeBuilder builder = new HtmlAttributeBuilder();
            var result = builder.If( condition, x => x.Attribute( attributeName, attributeValue ) );

            Assert.AreSame( builder, result );
            Assert.IsTrue( builder.Attributes.ContainsKey( attributeName ) );
        }
        public void ConditionTrueDoesNotInvokesFalseAttributeExpression()
        {
            bool condition = true;
            string attributeName = "Name";
            string attributeValue = "Value";

            HtmlAttributeBuilder builder = new HtmlAttributeBuilder();
            var result = builder.If( condition, null, x => x.Attribute( attributeName, attributeValue ) );

            Assert.AreSame( builder, result );
            Assert.IsTrue( builder.Attributes.Count == 0 );
        }