コード例 #1
0
        public void PseudoContains_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "PseudoContains";
            string styleOutput = GetStyleOutput(file);

            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "xitem_main_main_body";
            string content = "contain";
            bool returnValue1 = _validate.ValidateOfficeTextNodeList(1, content, "para");
            Assert.IsTrue(returnValue1);

            content = "XXcontain";
            returnValue1 = _validate.ValidateOfficeTextNodeList(2, content, "para");
            Assert.IsTrue(returnValue1, "Counter1 - Content Failure");

            content = "sakple text file lang";
            returnValue1 = _validate.ValidateOfficeTextNodeList(3, content, "para");
            Assert.IsTrue(returnValue1, "Counter1 - Content Failure");

            //Content Test - First
            //_validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            //_validate.ClassName = "xitem..contains_main_body";
            //string content = "contain";
            //bool returnValue1 = _validate.v.ValidateOfficeTextNode(content, "span");
            //Assert.IsTrue(returnValue1);

            //_validate.ClassName = "xitem-xitem..contains_main_body";
            //content = "XXcontain";
            //returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            //Assert.IsTrue(returnValue1);

            ////Note - The Styles will be created while processing xhtml(content.xml)
            ////Style Test - Second
            //_validate = new ValidateXMLFile(styleOutput);

            //_validate.ClassName = "xitem-xitem..contains_main_body";
            //_validate.ClassProperty.Add("fo:color", "#008000");
            //_validate.ClassProperty.Add("fo:font-size", "18pt");

            //bool returnValue = _validate.ValidateNodeAttributesNS(false);
            //Assert.IsTrue(returnValue);

            //_validate.ClassName = "xitem..contains_main_body";
            //_validate.ClassProperty.Add("fo:color", "#ff0000");
            //_validate.ClassProperty.Add("fo:font-size", "36pt");

            //returnValue = _validate.ValidateNodeAttributesNS(false);
            //Assert.IsTrue(returnValue);

        }
コード例 #2
0
        public void PseudoBefore_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "PseudoBefore";
            string styleOutput = GetStyleOutput(file);

            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "letHead_dicBody";
            string content = Common.ConvertUnicodeToString("\\2666") + "let Head";
            bool returnValue1 = _validate.ValidateOfficeTextNodeList(1, content, "para");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "letData_dicBody";
            content = ": let Data";
            returnValue1 = _validate.ValidateOfficeTextNodeList(1, content, "para");
            Assert.IsTrue(returnValue1);
        }
コード例 #3
0
        public void SignificantSpace()
        {
            const string file = "SignificantSpace";
            _projInfo.ProjectInputType = "Dictionary";
            string styleOutput = GetStyleOutput(file);

            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "entry_letData_dicBody";
            //_validate.GetInnerText = true;
            string content = "<text:span text:style-name=\"partofspeech_.en_sense_senses_entry_letData_dicBody\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\">No space between the spans -------------------------&gt; v</text:span><text:span text:style-name=\"definition_.en_sense_senses_entry_letData_dicBody\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\">light </text:span><text:span text:style-name=\"blue_senses_entry_letData_dicBody\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\">(COMING TOGETHER) </text:span>";
            bool returnValue1 = _validate.ValidateOfficeTextNodeList(1, content, "para");
            Assert.IsTrue(returnValue1, "SignificantSpace - Content Failure");

            content = "<text:span text:style-name=\"partofspeech_.en_gram_sense_senses_entry_letData_dicBody\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\">Two end span and start span -------------------------&gt; v</text:span><text:span text:style-name=\"definition_.en_sense_senses_entry_letData_dicBody\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\">light (COMING WITH ONE SPACE)</text:span>";
            returnValue1 = _validate.ValidateOfficeTextNodeList(2, content, "para");
            Assert.IsTrue(returnValue1, "SignificantSpace - Content Failure");

            content = "<text:span text:style-name=\"partofspeech_.en_sense_senses_entry_letData_dicBody\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\"> One end span and start span -------------------------&gt; v</text:span><text:span text:style-name=\"definition_.en_sense_senses_entry_letData_dicBody\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\">light (COMING WITH ONE SPACE)</text:span>";
            returnValue1 = _validate.ValidateOfficeTextNodeList(3, content, "para");
            Assert.IsTrue(returnValue1, "SignificantSpace - Content Failure");

            content = "<text:span text:style-name=\"partofspeech_.en_sense_senses_entry_letData_dicBody\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\">Horizontal continues span without cr lf - long space ---&gt; v</text:span><text:span text:style-name=\"definition_.en_sense_senses_entry_letData_dicBody\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\">light (COMING WITH ONE SPACE)</text:span>";
            returnValue1 = _validate.ValidateOfficeTextNodeList(4, content, "para");
            Assert.IsTrue(returnValue1, "SignificantSpace - Content Failure");
        }
コード例 #4
0
        public void PseudoAfter1_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "PseudoAfter1";

            string styleOutput = GetStyleOutput(file);
            //_validate = new ValidateXMLFile(styleOutput);
            //_validate.ClassName = "letHead..after_div_dicBody";
            //_validate.ClassProperty.Add("fo:font-size", "18pt");
            //_validate.ClassProperty.Add("style:font-size-complex", "18pt");
            //_validate.ClassProperty.Add("fo:color", "#ffa500");
            //bool returnValue = _validate.ValidateNodeAttributesNS(false);
            //Assert.IsTrue(returnValue);

            //_validate.ClassName = "letHead-letHead..after_div_dicBody";
            //_validate.ClassProperty.Add("fo:font-size", "25pt");
            //_validate.ClassProperty.Add("style:font-size-complex", "25pt");
            //_validate.ClassProperty.Add("fo:color", "#ffa500");
            //returnValue = _validate.ValidateNodeAttributesNS(false);
            //Assert.IsTrue(returnValue);

            //Content Test 
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "letHead_div_dicBody";
            string content = "A a<text:span text:style-name=\"entry_letHead_div_dicBody\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\">entry</text:span>###";
            bool returnValue1 = _validate.ValidateOfficeTextNodeList(1, content, "para");
            Assert.IsTrue(returnValue1, "PseudoAfter1 - Content Failure");

            content = "B b***";
            returnValue1 = _validate.ValidateOfficeTextNodeList(2, content, "para");
            Assert.IsTrue(returnValue1, "PseudoAfter1 - 2nd Content Failure");

        }
コード例 #5
0
        public void LanguageInlineBlock_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "LanguageInline";
            string styleOutput = GetStyleOutput(file);

            //Content Test 
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "partofspeech_entry_letData_dicBody";
            string content = "Select a destination";
            bool returnValue1 = _validate.ValidateOfficeTextNodeList(1, content, "para");
            Assert.IsTrue(returnValue1);

            returnValue1 = _validate.ValidateOfficeTextNodeList(2, content, "para");
            Assert.IsTrue(returnValue1);

            returnValue1 = _validate.ValidateOfficeTextNodeList(3, content, "para");
            Assert.IsTrue(returnValue1);
        }
コード例 #6
0
        public void Counter3_Node()
        {
            const string file = "Counter3";
            _projInfo.ProjectInputType = "Dictionary";
            string styleOutput = GetStyleOutput(file);

            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "sense_article_sectionletter_dictionary";
            _validate.GetInnerText = true;
            string content = "1.11";
            bool returnValue1 = _validate.ValidateOfficeTextNodeList(1, content, "span");
            Assert.IsTrue(returnValue1, "Counter3 - Content Failure");

            content = "1.22";
            returnValue1 = _validate.ValidateOfficeTextNodeList(2, content, "span");
            Assert.IsTrue(returnValue1, "Counter3 - Content Failure");

            content = "2.11";
            returnValue1 = _validate.ValidateOfficeTextNodeList(3, content, "span");
            Assert.IsTrue(returnValue1, "Counter3 - Content Failure");

            content = "2.22";
            returnValue1 = _validate.ValidateOfficeTextNodeList(4, content, "span");
            Assert.IsTrue(returnValue1, "Counter3 - Content Failure");

            ////Style Test - Second
            //_validate = new ValidateXMLFile(styleOutput);
            //_validate.ClassName = "sense..before_article_sectionletter_dictionary";

            //_validate.ClassProperty.Add("fo:font-weight", "700");
            //_validate.ClassProperty.Add("fo:font-weight-complex", "700");
            //_validate.ClassProperty.Add("fo:color", "#ff0000");

            //bool returnValue = _validate.ValidateNodeAttributesNS(false);
            //Assert.IsTrue(returnValue, "Counter3 - Style Failure");
        }