示例#1
0
        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");
        }
示例#2
0
        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");
        }
示例#3
0
        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");
        }
示例#4
0
        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");
        }
示例#5
0
        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");
        }
示例#6
0
        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");
        }
示例#7
0
        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");
        }
示例#8
0
        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");
        }