Пример #1
0
        public void ParseBlockAttributesTestCustomStyle()
        {
            string input   = "{color:blue;margin:30px}"; // TODO: Initialize to an appropriate value
            string element = "";                         // TODO: Initialize to an appropriate value

            string expected = " style=\"color:blue;margin:30px;\"";
            string actual   = BlockAttributesParser.ParseBlockAttributes(input, element);

            Assert.AreEqual(expected, actual);
        }
Пример #2
0
        public void ParseBlockAttributesTestLanguage()
        {
            string input   = "[fr]"; // TODO: Initialize to an appropriate value
            string element = "";     // TODO: Initialize to an appropriate value

            string expected = " lang=\"fr\"";
            string actual   = BlockAttributesParser.ParseBlockAttributes(input, element);

            Assert.AreEqual(expected, actual);
        }
Пример #3
0
        public void ParseBlockAttributesTestId()
        {
            string input   = "(#big-red)"; // TODO: Initialize to an appropriate value
            string element = "";           // TODO: Initialize to an appropriate value

            string expected = " id=\"big-red\"";
            string actual   = BlockAttributesParser.ParseBlockAttributes(input, element);

            Assert.AreEqual(expected, actual);
        }
Пример #4
0
        public void ParseBlockAttributesTestClassAndId()
        {
            string input   = "(example1#big-red2)"; // TODO: Initialize to an appropriate value
            string element = "";                    // TODO: Initialize to an appropriate value

            string expected = " class=\"example1\" id=\"big-red2\"";
            string actual   = BlockAttributesParser.ParseBlockAttributes(input, element);

            Assert.AreEqual(expected, actual);
        }
Пример #5
0
        public void ParseBlockAttributesRestricted3()
        {
            string element = "";

            string input    = "()>{color:red}";
            string expected = "";
            string actual   = BlockAttributesParser.ParseBlockAttributes(input, element, true);

            Assert.AreEqual(expected, actual);
        }
Пример #6
0
        public void ParseBlockAttributesRestricted1()
        {
            string input   = "[fr]";
            string element = "";

            string expected = " lang=\"fr\"";
            string actual   = BlockAttributesParser.ParseBlockAttributes(input, element, true);

            Assert.AreEqual(expected, actual);
        }
Пример #7
0
        public void ParseBlockAttributesCombinedAll()
        {
            string element = "";

            string input    = "()>[no]{color:red}";
            string expected = " style=\"color:red;padding-left:1em;padding-right:1em;text-align:right;\" lang=\"no\"";
            string actual   = BlockAttributesParser.ParseBlockAttributes(input, element);

            Assert.AreEqual(expected, actual);
        }
Пример #8
0
        public void ParseBlockAttributesCombinedAlignsAndIndents()
        {
            string element = "";

            string input    = "()>";
            string expected = " style=\"padding-left:1em;padding-right:1em;text-align:right;\"";
            string actual   = BlockAttributesParser.ParseBlockAttributes(input, element);

            Assert.AreEqual(expected, actual);
        }
Пример #9
0
        public void ParseBlockAttributesBlockAlign()
        {
            string element = "";

            string input    = "<";
            string expected = " style=\"text-align:left;\"";
            string actual   = BlockAttributesParser.ParseBlockAttributes(input, element);

            input    = ">";
            expected = " style=\"text-align:right;\"";
            actual   = BlockAttributesParser.ParseBlockAttributes(input, element);

            input    = "=";
            expected = " style=\"text-align:center;\"";
            actual   = BlockAttributesParser.ParseBlockAttributes(input, element);

            input    = "<>";
            expected = " style=\"text-align:justify;\"";
            actual   = BlockAttributesParser.ParseBlockAttributes(input, element);

            Assert.AreEqual(expected, actual);
        }
Пример #10
0
        public void ParseBlockAttributesTestBlockIndent()
        {
            string element = "";

            string input    = "(";
            string expected = " style=\"padding-left:1em;\"";
            string actual   = BlockAttributesParser.ParseBlockAttributes(input, element);

            input    = "((";
            expected = " style=\"padding-left:2em;\"";
            actual   = BlockAttributesParser.ParseBlockAttributes(input, element);

            input    = ")))";
            expected = "style=\"padding-right:3em;\"";
            actual   = BlockAttributesParser.ParseBlockAttributes(input, element);

            input    = ")";
            expected = " style=\"padding-right:1em;\"";
            actual   = BlockAttributesParser.ParseBlockAttributes(input, element);

            Assert.AreEqual(expected, actual);
        }
Пример #11
0
 protected string FormattedStylesAndAlignment()
 {
     return(BlockAttributesParser.Parse(_alignInfo + _attsInfo, UseRestrictedMode));
 }
 public string ParseRestrictedAttributes(string input)
 {
     return(BlockAttributesParser.Parse(input, true));
 }
 public string ParseBlockAttribute(string input)
 {
     return(BlockAttributesParser.Parse(input));
 }