示例#1
0
        public void OneStyleTest()
        {
            string style = "color:red";

            HtmlStyleAttributeCollection result = HtmlStyleParser.Parse(style);

            Output(result);
            Console.WriteLine(result.Join());

            Assert.AreEqual(1, result.Count);
            Assert.AreEqual("red", result["color"].Value);
        }
示例#2
0
        public void TwoStyleWithoutLastValueTest()
        {
            string style = " color: red; font-weight";

            HtmlStyleAttributeCollection result = HtmlStyleParser.Parse(style);

            Output(result);
            Console.WriteLine(result.Join());

            Assert.AreEqual(2, result.Count);
            Assert.AreEqual("red", result["color"].Value);
            Assert.AreEqual(null, result["font-weight"].Value);
        }