public void Adding_duplicate_css_class_does_nothing_when_attribute_ends_with_same_value() { // setup var doc = new XDoc("div").Attr("class", "foo test"); // test doc.AddCssClass("test"); // validation Assert.AreEqual("foo test", doc["@class"].AsText, "class not set to expected value"); }
public void Removing_empty_css_class_does_nothing() { // setup var doc = new XDoc("div").Attr("class", "test"); // test doc.AddCssClass(""); // validation Assert.AreEqual("test", doc["@class"].AsText, "class not set to expected value"); }
public void Adding_css_class_appends_to_existing_class_attribute() { // setup var doc = new XDoc("div").Attr("class", "foo"); // test doc.AddCssClass("test"); // validation Assert.AreEqual("foo test", doc["@class"].AsText, "class not set to expected value"); }
public void Adding_css_class_adds_missing_class_attribute() { // setup var doc = new XDoc("div"); // test doc.AddCssClass("test"); // validation Assert.AreEqual("test", doc["@class"].AsText, "class not set to expected value"); }
public void Adding_duplicate_css_class_does_nothing_when_attribute_starts_with_same_value() { // setup var doc = new XDoc("div").Attr("class", "test bar"); // test doc.AddCssClass("test"); // validation Assert.AreEqual("test bar", doc["@class"].AsText, "class not set to expected value"); }