Esempio n. 1
0
        public void Should_prepend_class_to_existing_one()
        {
            attributes["class"] = "foo";

            HtmlAttributesContainerExtensions.PrependCssClass(container.Object, "bar");

            Assert.Equal("bar foo", attributes["class"]);
        }
Esempio n. 2
0
 public void Should_not_throw_if_class_contains_partially_the_argument()
 {
     attributes["class"] = "foos";
     Assert.DoesNotThrow(() => HtmlAttributesContainerExtensions.ThrowIfClassIsPresent(container.Object, "foo", "bar"));
 }
Esempio n. 3
0
 public void Should_throw_if_class_contains_completely_the_argument()
 {
     attributes["class"] = "foo";
     Assert.Throws <NotSupportedException>(() => HtmlAttributesContainerExtensions.ThrowIfClassIsPresent(container.Object, "foo", "bar"));
 }
Esempio n. 4
0
 public void Should_not_throw_if_class_is_null()
 {
     attributes["class"] = null;
     Assert.DoesNotThrow(() => HtmlAttributesContainerExtensions.ThrowIfClassIsPresent(container.Object, "foo", "bar"));
 }
Esempio n. 5
0
        public void Prepend_should_add_class_if_not_present()
        {
            HtmlAttributesContainerExtensions.PrependCssClass(container.Object, "foo");

            Assert.Equal("foo", attributes["class"]);
        }
Esempio n. 6
0
        public void Should_add_a_css_class_to_attributes_collection_if_not_present()
        {
            HtmlAttributesContainerExtensions.AppendCssClass(container.Object, "foo");

            Assert.Equal("foo", attributes["class"]);
        }