public void Should_prepend_class_to_existing_one() { attributes["class"] = "foo"; HtmlAttributesContainerExtensions.PrependCssClass(container.Object, "bar"); Assert.Equal("bar foo", attributes["class"]); }
public void Should_not_throw_if_class_contains_partially_the_argument() { attributes["class"] = "foos"; Assert.DoesNotThrow(() => HtmlAttributesContainerExtensions.ThrowIfClassIsPresent(container.Object, "foo", "bar")); }
public void Should_throw_if_class_contains_completely_the_argument() { attributes["class"] = "foo"; Assert.Throws <NotSupportedException>(() => HtmlAttributesContainerExtensions.ThrowIfClassIsPresent(container.Object, "foo", "bar")); }
public void Should_not_throw_if_class_is_null() { attributes["class"] = null; Assert.DoesNotThrow(() => HtmlAttributesContainerExtensions.ThrowIfClassIsPresent(container.Object, "foo", "bar")); }
public void Prepend_should_add_class_if_not_present() { HtmlAttributesContainerExtensions.PrependCssClass(container.Object, "foo"); Assert.Equal("foo", attributes["class"]); }
public void Should_add_a_css_class_to_attributes_collection_if_not_present() { HtmlAttributesContainerExtensions.AppendCssClass(container.Object, "foo"); Assert.Equal("foo", attributes["class"]); }