コード例 #1
0
ファイル: LOContentTest.cs プロジェクト: sillsdev/pathway
        public void SubscriptForNewFlexTest()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file        = "SubscriptForNewFlex";
            string       styleOutput = GetStyleOutput(file);

            //Content Test - First
            _validate              = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName    = "mainheadwordst_.bzh_span_.bzh_mainheadword_entry_letData_dicBody";
            _validate.GetInnerText = true;
            const string content      = "1";
            bool         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 = "mainheadwordst_.bzh_span_.bzh_mainheadword_entry_letData_dicBody";
            _validate.ClassProperty.Add("fo:font-weight", "700");
            _validate.ClassProperty.Add("style:font-weight-complex", "700");
            _validate.ClassProperty.Add("fo:font-size", "12pt");
            _validate.ClassProperty.Add("style:font-size-complex", "12pt");
            _validate.ClassProperty.Add("style:text-position", "-12% 58%");
            bool returnValue = _validate.ValidateNodeAttributesNS(false);

            Assert.IsTrue(returnValue);
        }
コード例 #2
0
        public void PseudoQuotes_Node()
        {
            const string file = "PseudoQuotes";
            _projInfo.ProjectInputType = "Dictionary";
            string styleOutput = GetStyleOutput(file);

            _validate = new ValidateXMLFile(styleOutput);
            _validate.ClassName = "xsensenumber..before_sense_senses_entry_letData_dicBody";
            _validate.ClassProperty.Add("fo:font-weight", "700");
            _validate.ClassProperty.Add("style:font-weight-complex", "700");
            _validate.ClassProperty.Add("fo:font-size", "18pt");
            _validate.ClassProperty.Add("style:font-size-complex", "18pt");
            _validate.ClassProperty.Add("fo:color", "#008000");
            bool returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);

            _validate.ClassName = "pronunciations..after_entry_letData_dicBody";
            _validate.ClassProperty.Add("fo:font-weight", "700");
            _validate.ClassProperty.Add("style:font-weight-complex", "700");
            _validate.ClassProperty.Add("fo:font-size", "40pt");
            _validate.ClassProperty.Add("style:font-size-complex", "40pt");
            _validate.ClassProperty.Add("fo:color", "#ff0000");
            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);


            _validate.ClassName = "translation..before_translations_xitem_examples_sense_senses_entry_letData_dicBody";
            _validate.ClassProperty.Add("fo:font-weight", "700");
            _validate.ClassProperty.Add("style:font-weight-complex", "700");
            _validate.ClassProperty.Add("fo:font-size", "15pt");
            _validate.ClassProperty.Add("style:font-size-complex", "15pt");
            _validate.ClassProperty.Add("fo:color", "#008000");
            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);

            _validate.ClassName = "translation..after_translations_xitem_examples_sense_senses_entry_letData_dicBody";
            _validate.ClassProperty.Add("fo:font-weight", "700");
            _validate.ClassProperty.Add("style:font-weight-complex", "700");
            _validate.ClassProperty.Add("fo:font-size", "15pt");
            _validate.ClassProperty.Add("style:font-size-complex", "15pt");
            _validate.ClassProperty.Add("fo:color", "#ff0000");
            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);

            _validate.ClassName = "headword..after_entry_letData_dicBody";
            _validate.ClassProperty.Add("fo:font-weight", "700");
            _validate.ClassProperty.Add("style:font-weight-complex", "700");
            _validate.ClassProperty.Add("fo:font-size", "50pt");
            _validate.ClassProperty.Add("style:font-size-complex", "50pt");
            _validate.ClassProperty.Add("fo:color", "#ff0000");
            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);

            _validate.ClassName = "headword..before_entry_letData_dicBody";
            _validate.ClassProperty.Add("fo:font-weight", "700");
            _validate.ClassProperty.Add("style:font-weight-complex", "700");
            _validate.ClassProperty.Add("fo:font-size", "50pt");
            _validate.ClassProperty.Add("style:font-size-complex", "50pt");
            _validate.ClassProperty.Add("fo:color", "#0000ff");
            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);

            _validate.ClassName = "letHead..before_dicBody";
            _validate.ClassProperty.Add("fo:font-weight", "700");
            _validate.ClassProperty.Add("style:font-weight-complex", "700");
            _validate.ClassProperty.Add("fo:font-size", "20pt");
            _validate.ClassProperty.Add("style:font-size-complex", "20pt");
            _validate.ClassProperty.Add("fo:color", "#0000ff");
            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);


            _validate.ClassName = "definition..before_sense_senses_entry_letData_dicBody";
            _validate.ClassProperty.Add("fo:font-weight", "700");
            _validate.ClassProperty.Add("style:font-weight-complex", "700");
            _validate.ClassProperty.Add("fo:font-size", "35pt");
            _validate.ClassProperty.Add("style:font-size-complex", "35pt");
            _validate.ClassProperty.Add("fo:color", "#ffa500");
            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);

            _validate.ClassName = "definition..after_sense_senses_entry_letData_dicBody";
            _validate.ClassProperty.Add("fo:font-weight", "700");
            _validate.ClassProperty.Add("style:font-weight-complex", "700");
            _validate.ClassProperty.Add("fo:font-size", "35pt");
            _validate.ClassProperty.Add("style:font-size-complex", "35pt");
            _validate.ClassProperty.Add("fo:color", "#ffa500");
            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);

            _validate.ClassName = "sense..before_senses_entry_letData_dicBody";
            _validate.ClassProperty.Add("fo:font-weight", "700");
            _validate.ClassProperty.Add("style:font-weight-complex", "700");
            _validate.ClassProperty.Add("fo:font-size", "18pt");
            _validate.ClassProperty.Add("style:font-size-complex", "18pt");
            _validate.ClassProperty.Add("fo:color", "#000000");
            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);


            _validate.ClassName = "sense..after_senses_entry_letData_dicBody";
            _validate.ClassProperty.Add("fo:font-weight", "700");
            _validate.ClassProperty.Add("style:font-weight-complex", "700");
            _validate.ClassProperty.Add("fo:font-size", "18pt");
            _validate.ClassProperty.Add("style:font-size-complex", "18pt");
            _validate.ClassProperty.Add("fo:color", "#800080");
            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);

            //Content Test - 
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "headword..before_entry_letData_dicBody";
            string content = "\"";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "headword..after_entry_letData_dicBody";
            content = "'";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "pronunciations..after_entry_letData_dicBody";
            content = Common.ConvertUnicodeToString("\\25ba");
            returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "sense..before_senses_entry_letData_dicBody";
            content = "' ' ' '" + Common.ConvertUnicodeToString("\\25ba") + " ' '' ' multi singles with uni";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "xsensenumber..before_sense_senses_entry_letData_dicBody";
            content = Common.ConvertUnicodeToString("\\25ba");
            returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);


            _validate.ClassName = "definition..before_sense_senses_entry_letData_dicBody";
            content = "<'-'>";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "definition..after_sense_senses_entry_letData_dicBody";
            content = "<\"-\">";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "translation..before_translations_xitem_examples_sense_senses_entry_letData_dicBody";
            content = "''" + Common.ConvertUnicodeToString("\\2565") + "'' two single with uni";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "translation..after_translations_xitem_examples_sense_senses_entry_letData_dicBody";
            content = "\"\"" + Common.ConvertUnicodeToString("\\2115") + "\"\" two double with uni";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "sense..after_senses_entry_letData_dicBody";
            content = "\" \" \" \"" + Common.ConvertUnicodeToString("\\25ba") + "\" \" \" multi double with uni";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);
        }
コード例 #3
0
        public void AncestorChildTest_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "AncestorChildTest";
            string styleOutput = GetStyleOutput(file);


            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "letter.-locator_locator_dictionary";
            string content = "a";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "letter.-locator_xitem_locator_dictionary";
            content = "c";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "locator_dictionary";
            content = "j orange";
            returnValue1 = _validate.ValidateOfficeTextNode(11, content, "para");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "letter.-current_locator_dictionary";
            content = "w";
            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 = "letter.-locator_locator_dictionary";
            _validate.ClassProperty.Add("fo:font-weight", "700");
            _validate.ClassProperty.Add("style:font-weight-complex", "700");
            _validate.ClassProperty.Add("fo:font-size", "20pt");
            _validate.ClassProperty.Add("style:font-size-complex", "20pt");
            _validate.ClassProperty.Add("fo:color", "#0000ff");
            bool returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);

            _validate.ClassName = "letter.-locator_xitem_locator_dictionary";
            _validate.ClassProperty.Add("fo:font-weight", "700");
            _validate.ClassProperty.Add("style:font-weight-complex", "700");
            _validate.ClassProperty.Add("fo:font-size", "20pt");
            _validate.ClassProperty.Add("style:font-size-complex", "20pt");
            _validate.ClassProperty.Add("fo:color", "#0000ff");
            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);

            _validate.ClassName = "letter.-current_locator_dictionary";
            _validate.ClassProperty.Add("fo:color", "#ff0000");
            _validate.ClassProperty.Add("fo:background-color", "#aaff00");

            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);
        }
コード例 #4
0
        public void MultiClass_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "multiClass";
            string styleOutput = GetStyleOutput(file);

            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "a.-b.-c_main_body";
            string content = "sample text file b a c";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "a_main_body";
            content = "sample text file a";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "b_main_body";
            content = "sample text file b";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "a.-c_main_body";
            content = "sample text file a c";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1);


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


            _validate.ClassName = "a.-b.-c_main_body";
            _validate.ClassProperty.Add("fo:color", "#ffa500");
            _validate.ClassProperty.Add("fo:font-size", "24pt");

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

            _validate.ClassName = "a_main_body";
            _validate.ClassProperty.Add("fo:color", "#0000ff");
            _validate.ClassProperty.Add("fo:font-size", "18pt");

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


            _validate.ClassName = "b_main_body";
            _validate.ClassProperty.Add("fo:color", "#ff0000");

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


            _validate.ClassName = "a.-c_main_body";
            _validate.ClassProperty.Add("fo:color", "#ffa500");
            _validate.ClassProperty.Add("fo:font-size", "18pt");

            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);
        }
コード例 #5
0
        public void TextReplaceTest_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "TextReplace";
            string styleOutput = GetStyleOutput(file);

            //Content Test
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "span_NoteGeneralParagraph_scrSection_scrBook_scrBody";
            string content = "Kori haghore Grik " + Common.ConvertUnicodeToString("\\201C") + "Oti veikisighi." + Common.ConvertUnicodeToString("\\201D") + " Na puhi kena eia mara i hau bali tateli aua nidia na dotho, imarea kena kisia na bakodia ara kuladia kiloau.";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);
        }
コード例 #6
0
        public void DisplayInline_Node()
        {
            const string file = "DisplayInline";
            _projInfo.ProjectInputType = "Dictionary";
            string styleOutput = GetStyleOutput(file);

            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "letter_letHead_dicBody";
            _validate.GetInnerText = true;
            string content = "A a";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1, "DisplayInline failed");
        }
コード例 #7
0
        public void Textindent_Node()
        {
            const string file = "Textindent";
            _projInfo.ProjectInputType = "Dictionary";
            string styleOutput = GetStyleOutput(file);

            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "t1_body";
            string content = "You and all the people of Israel: It is by the name of Jesus Christ of Nazareth, whom you crucified but whom God raised from the dead, that this man stands before you healed. <text:span text:style-name=\"verse_t1_body\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\">11</text:span>He is \" 'the stone you builders rejected, which has become the capstone.[a]'[b] <text:span text:style-name=\"verse_t1_body\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\">12</text:span><text:span text:style-name=\"salvation_t1_body\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\"> Salvation is found in no one else, for there is no other name under heaven given to men by which we must be saved.\" </text:span>";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1);

            //Note - The Styles will be created while processing xhtml(content.xml)
            //Style Test - Second
            _validate = new ValidateXMLFile(styleOutput);
            _validate.ClassName = "t1_body";
            _validate.ClassProperty.Add("fo:text-indent", "100pt");
            bool returnValue = _validate.ValidateNodeAttributesNS(true);
            Assert.IsTrue(returnValue);
        }
コード例 #8
0
        public void VerseNumber_Node()
        {

            _projInfo.ProjectInputType = "Dictionary";
            const string file = "VerseNumber";

            string styleOutput = GetStyleOutput(file);
            //
            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "VerseNumber_Paragraph_scrSection_columns_scrBook_scrBody";
            string content = "1";
            bool 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 = "VerseNumber_Paragraph_scrSection_columns_scrBook_scrBody";

            _validate.ClassProperty.Add("fo:font-family", "Charis SIL");
            _validate.ClassProperty.Add("style:font-name-complex", "Charis SIL");
            _validate.ClassProperty.Add("style:text-position", "super 55%");
            _validate.ClassProperty.Add("fo:color", "#ff0000");
            _validate.ClassProperty.Add("fo:font-style", "italic");
            _validate.ClassProperty.Add("fo:background-color", "#0000ff");

            bool returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue, "VerseNumber - Style Failure");
        }
コード例 #9
0
        public void Language_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "Language";
            string styleOutput = GetStyleOutput(file);

            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "xitem_.en_main_body";
            string content = "sample text file";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "xitem_.fr_main_body";
            content = "exemple de fichier texte";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "xitem_.es_main_body";
            content = "Este es muestra texto";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "xitem_.fr-FR_main_body";
            content = "exemple de fichier texte";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "xitem_.es-ES_main_body";
            content = "Este es muestra texto";
            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_.en_main_body";
            _validate.ClassProperty.Add("fo:language", "en");
            _validate.ClassProperty.Add("fo:country", "US");
            bool returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);

            _validate.ClassName = "xitem_.fr_main_body";
            _validate.ClassProperty.Add("fo:language", "fr");
            _validate.ClassProperty.Add("fo:country", "FR");
            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);

            _validate.ClassName = "xitem_.es_main_body";
            _validate.ClassProperty.Add("fo:language", "es");
            _validate.ClassProperty.Add("fo:country", "ES");
            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);

            _validate.ClassName = "xitem_.fr-FR_main_body";
            _validate.ClassProperty.Add("fo:language", "fr");
            _validate.ClassProperty.Add("fo:country", "FR");
            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);

            _validate.ClassName = "xitem_.es-ES_main_body";
            _validate.ClassProperty.Add("fo:language", "es");
            _validate.ClassProperty.Add("fo:country", "ES");
            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);

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

            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = string.Empty;
            _validate.GetOuterXml = true;
            _validate.XPath = "//draw:frame[@draw:style-name='gr2']";
            string content = "<draw:frame draw:style-name=\"gr2\" draw:name=\"Graphics2\" text:anchor-type=\"paragraph\" svg:width=\"72pt\" svg:height=\"72pt\" xmlns:svg=\"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\" xmlns:draw=\"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0\"><draw:image xlink:type=\"simple\" xlink:show=\"embed\" xlink:actuate=\"onLoad\" xlink:href=\"Pictures/c.jpg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" /><svg:title>c.jpg</svg:title></draw:frame>";
            bool returnValue = _validate.ValidateOfficeTextNode(0, content, "para");
            Assert.IsTrue(returnValue);
        }
コード例 #11
0
        public void Picture_Width_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "PictureWidth";
            string styleOutput = GetStyleOutput(file);

            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "entry1_letData_dicBody";
            _validate.ClassNameTrim = true;
            _validate.GetOuterXml = true;
            string content = "<text:p text:style-name=\"entry1_letData_dicBody\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\"><draw:frame draw:style-name=\"Graphics1\" draw:name=\"Graphics1\" text:anchor-type=\"paragraph\" draw:z-index=\"1\" svg:width=\"45pt\" svg:height=\"33.75pt\" xmlns:svg=\"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0\" xmlns:draw=\"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0\"><draw:text-box fo:min-height=\"0in\" xmlns:fo=\"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0\"><draw:frame draw:style-name=\"Graphics1\" draw:name=\"Graphics1\" text:anchor-type=\"paragraph\" svg:width=\"45pt\" svg:height=\"33.75pt\"><draw:image xlink:type=\"simple\" xlink:show=\"embed\" xlink:actuatet=\"onLoad\" xlink:href=\"Pictures/leftindexmacro1.jpg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" /><svg:title>leftindexmacro1.jpg</svg:title></draw:frame><text:p text:style-name=\"pictureCaption_pictureRight_entry1_letData_dicBody\"><text:span text:style-name=\"CmPicturepublishStemCaptionSenseNumber_pictureCaption_pictureRight_entry1_letData_dicBody\">1</text:span><text:span text:style-name=\"CmPicturepublishStemCaptionCaptionPub_.pt_pictureCaption_pictureRight_entry1_letData_dicBody\">cala</text:span></text:p></draw:text-box></draw:frame><text:span text:style-name=\"headword_entry1_letData_dicBody\">cala</text:span><text:span text:style-name=\"headword..after_entry1_letData_dicBody\"><text:s text:c=\"1\" /></text:span><text:span text:style-name=\"partofspeech_.pt_grammaticalinfo_sense_senses_entry1_letData_dicBody\">N</text:span><text:span text:style-name=\"xlanguagetag_xitem_.pt_definitionL2_.pt_sense_senses_entry1_letData_dicBody\">Por </text:span><text:span text:style-name=\"xitem_.pt_definitionL2_.pt_sense_senses_entry1_letData_dicBody\">dedo</text:span><text:span text:style-name=\"xlanguagetag_xitem_.en_definitionL2_.pt_sense_senses_entry1_letData_dicBody\">Eng </text:span><text:span text:style-name=\"xitem_.en_definitionL2_.pt_sense_senses_entry1_letData_dicBody\">finger</text:span></text:p>";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1, "PictureWidth - Content 1 Failure");

            // Display:None
            //_validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            //_validate.ClassName = "pictureRightNone_entry2_letData_dicBody";
            //_validate.ClassNameTrim = true;
            //_validate.GetInnerText = true;
            //content = "cadu";
            //returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            //Assert.IsTrue(returnValue1, "PictureWidth - Content 2 Failure");
        }
コード例 #12
0
        public void Larger_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "Larger";

            string styleOutput = GetStyleOutput(file);

            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "p4_body";
            _validate.ClassNameTrim = true;
            string content = "<text:span text:style-name=\"child1_p4_body\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\"> text </text:span><text:span text:style-name=\"child2_p4_body\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\">text </text:span>";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1, "Larger - Content 1 Failure");

            _validate = new ValidateXMLFile(styleOutput);
            _validate.ClassName = "child1_p4_body";
            _validate.ClassProperty.Add("fo:font-size", "120");
            bool returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);

            _validate.ClassName = "child2_p4_body";
            _validate.ClassProperty.Add("fo:font-size", "53");
            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);
        }
コード例 #13
0
        public void PseudoAfter_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "PseudoAfter";

            string styleOutput = GetStyleOutput(file);

            //_validate = new ValidateXMLFile(styleOutput);
            //_validate.ClassName = "headword..after_entry_letData_dicBody";
            //_validate.ClassProperty.Add("fo:font-size", "12pt");
            //_validate.ClassProperty.Add("style:font-size-complex", "12pt");
            //_validate.ClassProperty.Add("fo:color", "#000000");
            //bool returnValue = _validate.ValidateNodeAttributesNS(false);
            //Assert.IsTrue(returnValue);

            //Content Test 
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "pronunciation_pronunciations_entry_letData_dicBody";
            string content = "text]";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);

            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "span_entry_letData_dicBody";
            content = "again";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);
        }
コード例 #14
0
        public void LanguageColor_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "LanguageColor";
            string styleOutput = GetStyleOutput(file);

            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "xlanguagetag_xitem_.pt_definitionL2_sense_senses_entry_letData_dicBody";
            _validate.ClassNameTrim = false;
            string content = "Por ";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1, "LanguageColor - Content 1 Failure");

            _validate.ClassName = "xitem_.en_definitionL2_sense_senses_entry_letData_dicBody";
            _validate.ClassNameTrim = true;
            content = "he";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1, "LanguageColor - Content 2 Failure");

            //Note - The Styles will be created while processing xhtml(content.xml)
            //Style Test - Second
            _validate = new ValidateXMLFile(styleOutput);
            _validate.ClassName = "xlanguagetag_xitem_.pt_definitionL2_sense_senses_entry_letData_dicBody";
            _validate.ClassProperty.Add("fo:color", "#2F60FF");
            bool returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue, "LanguageColor - Style Failure");

            _validate.ClassName = "xitem_.en_definitionL2_sense_senses_entry_letData_dicBody";
            _validate.ClassProperty.Add("fo:color", "#FF00FF");
            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue, "LanguageColor - Style Failure");

        }
コード例 #15
0
        public void TeluguGondwana_Node()
        {
            const string file = "TeluguGondwana";

            _projInfo.ProjectInputType = "Dictionary";
            string styleOutput = GetStyleOutput(file);

            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "span_.ggo-Telu-IN_TitleMain_scrBook_scrBody";
            string content = Common.ConvertUnicodeToString("\\C06");
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);


            ////Note - The Styles will be created while processing xhtml(content.xml)
            ////Commented because of ldml files.
            ////Style Test - Second
            //_validate = new ValidateXMLFile(styleOutput);
            //_validate.ClassName = "span_.ggo-Telu-IN_TitleMain_scrBook_scrBody";
            //_validate.ClassProperty.Add("fo:font-name", "Gautami");
            //_validate.ClassProperty.Add("style:font-name-complex", "Gautami");
            //bool returnValue = _validate.ValidateNodeAttributesNS(false);
            //Assert.IsTrue(returnValue);

            //string xpath = "//office:font-face-decls";
            //_validate.ClassName = string.Empty;
            //_validate.ClassProperty.Add("svg:font-family", "Gautami");
            //returnValue = _validate.ValidateNodeAttributesNS(9, xpath);
            //Assert.IsTrue(returnValue);
        }
コード例 #16
0
        public void EmptyDivTag_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "EmptyDivTag";
            string styleOutput = GetStyleOutput(file);

            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "border";
            _validate.ClassNameTrim = false;
            bool returnValue1 = _validate.ValidateOfficeTextNode("para");
            Assert.IsTrue(returnValue1, "EmptyDivTag - Content  Failure");

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

            _validate.ClassProperty.Add("fo:border-top", ".5pt solid #000000");
            _validate.ClassProperty.Add("fo:text-align", "center");
            _validate.ClassProperty.Add("fo:margin-left", "1in");
            _validate.ClassProperty.Add("fo:margin-right", "1in");
            _validate.ClassProperty.Add("fo:margin-top", "9pt");
            _validate.ClassProperty.Add("fo:margin-bottom", "18pt");
            //TODO AFTER FINISHING BORDER PROPERTY CHECK THIS.
            //bool returnValue = _validate.ValidateNodeAttributesNS(true);
            //Assert.IsTrue(returnValue, "EmptyDivTag - Style Failure");

        }
コード例 #17
0
        public void ClassContent_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "ClassContent";

            string styleOutput = GetStyleOutput(file);
            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "xlanguagetag_.en_xitem_.tpi_definition_.en_sense_senses_entry_letData";
            _validate.ClassNameTrim = true;
            string content = "/";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1, "ClassContent - Content 1 Failure");

            //Note - The Styles will be created while processing xhtml(content.xml)
            //Style Test - Second
            _validate = new ValidateXMLFile(styleOutput);
            _validate.ClassName = "xlanguagetag_.en_xitem_.tpi_definition_.en_sense_senses_entry_letData";
            _validate.ClassProperty.Add("fo:font-size", "38pt");
            _validate.ClassProperty.Add("style:font-size-complex", "38pt");
            _validate.ClassProperty.Add("fo:color", "#ff0000");
            bool returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue, "ClassContent - Style 1 Failure");
        }
コード例 #18
0
        public void BackgroundWhiteColor_Removal_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "BackgroundWhiteRemoval";

            string styleOutput = GetStyleOutput(file);

            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "t1_body";
            string content = "T1 class";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "t2_t1_body";
            content = "T2 class";

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

            _validate.ClassName = "t3_t2_t1_body";
            content = "T3 class";

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

            _validate = new ValidateXMLFile(styleOutput);
            _validate.ClassName = "t1_body";
            _validate.ClassProperty.Add("fo:text-align", "left");
            _validate.ClassProperty.Add("fo:background-color", "#008000");
            bool returnValue = _validate.ValidateNodeAttributesNS(true);
            Assert.IsTrue(returnValue);

            _validate.ClassProperty.Add("fo:font-size", "12pt");
            _validate.ClassProperty.Add("style:font-size-complex", "12pt");
            _validate.ClassProperty.Add("fo:color", "#ff0000");
            //_validate.ClassProperty.Add("fo:background-color", "#008000");

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

            _validate.ClassName = "t2_t1_body";
            _validate.ClassProperty.Add("fo:text-align", "left");
            returnValue = _validate.ValidateNodeAttributesNS(true);
            Assert.IsTrue(returnValue);

            _validate.ClassProperty.Add("fo:color", "#0000ff");
            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);

            _validate.ClassProperty.Add("fo:background-color", "#ffffff");
            returnValue = _validate.ValidateNodeAttributesNS(true);
            Assert.IsFalse(returnValue);  // white color should not be there.
        }
コード例 #19
0
        public void div_header_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "div_header";
            string styleOutput = GetStyleOutput(file);

            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "div.header_main";
            _validate.ClassNameTrim = true;
            string content = "Main Title";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1, "div_header - Content 1 Failure");

            //Note - The Styles will be created while processing xhtml(content.xml)
            //Style Test - Second
            _validate = new ValidateXMLFile(styleOutput);
            _validate.ClassName = "div.header_main";
            _validate.ClassProperty.Add("fo:font-size", "24pt");
            _validate.ClassProperty.Add("style:font-size-complex", "24pt");
            bool returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue, "div_header - Style 1 Failure");
        }
コード例 #20
0
        public void DisplayNone_Node()
        {
            const string file = "DisplayNone";
            _projInfo.ProjectInputType = "Dictionary";
            string styleOutput = GetStyleOutput(file);

            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "divColor1_body";
            _validate.GetInnerText = true;
            string content = "Span Color1 class Divcolor 1";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1, "div color failed");


            _validate.ClassName = "spanColor2_divColor2_body";
            _validate.GetInnerText = true;
            content = "Span Color2 class";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1, "span color failed");

            //Note - The Styles will be created while processing xhtml(content.xml)
            //Style Test - Second
            _validate = new ValidateXMLFile(styleOutput);
            //_validate.ClassName = "divColor1_body";
            //_validate.ClassProperty.Add("fo:background-color", "#008000");
            //bool returnValue = _validate.ValidateNodeAttributesNS(true);
            //Assert.IsFalse(returnValue, "div does not have background color");

            _validate.ClassName = "spanColor2_divColor2_body";
            _validate.ClassProperty.Add("fo:background-color", "#ff0000");
            bool returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue, "span does not have background color ");

        }
コード例 #21
0
        public void ContentNormalTest_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "ContentNormalTest";

            string styleOutput = GetStyleOutput(file);

            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "entry_letData_dicBody";
            _validate.ClassNameTrim = false;
            _validate.GetInnerText = true;
            string content = "ba VPor roubar Eng steal the converted valuesPor the converted values Eng child of Fatima Por the converted values Eng child of Fatima 11Por child of god Por the converted values Eng child of Fatima Por the converted values Por Unicode characters Eng child of Fatima ";

            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1, "ContentNormalTest - Content 1 Failure");

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


            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "t1_body";
            string content = "T1 class";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "t2_t1_body";
            content = "T2 class";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "t3_t2_t1_body";
            content = "T3 class";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "t4_t3_t2_t1_body";
            content = "T4 class";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "t4_t2_t1_body";
            content = "T4 class";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "t4_t1_body";
            content = "T4 class";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1);

        }
コード例 #23
0
        public void Picture_ImageAttrib_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "ImageAttrib";

            _projInfo.DefaultCssFileWithPath = FileInput(file + ".css");
            _projInfo.DefaultXhtmlFileWithPath = FileInput(file + ".xhtml");

            PreExportProcess preProcessor = new PreExportProcess(_projInfo);
            preProcessor.GetTempFolderPath();
            preProcessor.ImagePreprocess(false);
            _projInfo.DefaultXhtmlFileWithPath = preProcessor.ProcessedXhtml;

            string styleOutput = GetStyleOutput(_projInfo);

            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = string.Empty;
            _validate.GetOuterXml = true;
            _validate.XPath = "//draw:frame[@draw:style-name='fr2']";
            string content = "<draw:frame draw:style-name=\"fr2\" draw:name=\"Frame2\" text:anchor-type=\"paragraph\" draw:z-index=\"1\" svg:width=\"288pt\" svg:height=\"144pt\" xmlns:svg=\"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\" xmlns:draw=\"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0\"><draw:text-box fo:min-height=\"1in\" xmlns:fo=\"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0\"><draw:frame draw:style-name=\"gr2\" draw:name=\"Graphics2\" text:anchor-type=\"paragraph\" svg:width=\"288pt\" svg:height=\"144pt\"><draw:image xlink:type=\"simple\" xlink:show=\"embed\" xlink:actuate=\"onLoad\" xlink:href=\"Pictures/1.jpg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" /><svg:title>1.jpg</svg:title></draw:frame><text:span text:style-name=\"image_firstoftype sense_article_sectionletter_dictionary\"> Flea </text:span></draw:text-box></draw:frame>";
            bool returnValue = _validate.ValidateOfficeTextNode(0, content, "para");
            Assert.IsTrue(returnValue);

            _validate.XPath = "//draw:frame[@draw:name='Graphics2']";
            content = "<draw:frame draw:style-name=\"gr2\" draw:name=\"Graphics2\" text:anchor-type=\"paragraph\" svg:width=\"288pt\" svg:height=\"144pt\" xmlns:svg=\"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\" xmlns:draw=\"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0\"><draw:image xlink:type=\"simple\" xlink:show=\"embed\" xlink:actuate=\"onLoad\" xlink:href=\"Pictures/1.jpg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" /><svg:title>1.jpg</svg:title></draw:frame>";
            returnValue = _validate.ValidateOfficeTextNode(0, content, "para");
            Assert.IsTrue(returnValue);

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

            _validate.ClassProperty.Add("style:vertical-pos", "from-top");
            _validate.ClassProperty.Add("style:vertical-rel", "paragraph-content");
            _validate.ClassProperty.Add("style:horizontal-pos", "center");
            _validate.ClassProperty.Add("style:horizontal-rel", "paragraph");

            _validate.ClassProperty.Add("run-through", "foreground");
            _validate.ClassProperty.Add("number-wrapped-paragraphs", "no-limit");
            _validate.ClassProperty.Add("wrap-contour", "false");

            _validate.ClassProperty.Add("text:anchor-type", "paragraph");
            //_validate.ClassProperty.Add("svg:x", "0in");
            //_validate.ClassProperty.Add("svg:y", "0in");
            //_validate.ClassProperty.Add("style:mirror", "none");
            //_validate.ClassProperty.Add("fo:clip", "rect(0in 0in 0in 0in)");
            //_validate.ClassProperty.Add("draw:luminance", "0%");

            //_validate.ClassProperty.Add("draw:red", "0%");
            //_validate.ClassProperty.Add("draw:green", "0%");
            //_validate.ClassProperty.Add("draw:blue", "0%");
            //_validate.ClassProperty.Add("draw:gamma", "100%");
            //_validate.ClassProperty.Add("draw:color-inversion", "false");

            //_validate.ClassProperty.Add("draw:image-opacity", "100%");
            //_validate.ClassProperty.Add("draw:color-mode", "standard");
            //_validate.ClassProperty.Add("style:wrap", "parallel");

            returnValue = _validate.ValidateNodeAttributesNS(1, string.Empty);
            Assert.IsTrue(returnValue);

            _validate.ClassName = "fr3";
            _validate.ClassProperty.Add("style:vertical-pos", "from-top");
            _validate.ClassProperty.Add("style:vertical-rel", "paragraph-content");
            _validate.ClassProperty.Add("style:horizontal-pos", "center");
            _validate.ClassProperty.Add("style:horizontal-rel", "paragraph");

            _validate.ClassProperty.Add("run-through", "foreground");
            _validate.ClassProperty.Add("number-wrapped-paragraphs", "no-limit");
            _validate.ClassProperty.Add("wrap-contour", "false");

            _validate.ClassProperty.Add("text:anchor-type", "paragraph");
            //_validate.ClassProperty.Add("svg:x", "0in");
            //_validate.ClassProperty.Add("svg:y", "0in");
            //_validate.ClassProperty.Add("style:mirror", "none");
            //_validate.ClassProperty.Add("fo:clip", "rect(0in 0in 0in 0in)");
            //_validate.ClassProperty.Add("draw:luminance", "0%");

            //_validate.ClassProperty.Add("draw:red", "0%");
            //_validate.ClassProperty.Add("draw:green", "0%");
            //_validate.ClassProperty.Add("draw:blue", "0%");
            //_validate.ClassProperty.Add("draw:gamma", "100%");
            //_validate.ClassProperty.Add("draw:color-inversion", "false");

            //_validate.ClassProperty.Add("draw:image-opacity", "100%");
            //_validate.ClassProperty.Add("draw:color-mode", "standard");
            //_validate.ClassProperty.Add("style:wrap", "parallel");

            returnValue = _validate.ValidateNodeAttributesNS(1, string.Empty);
            Assert.IsTrue(returnValue);
        }
コード例 #24
0
        public void Precede1_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "Precede1";
            string styleOutput = GetStyleOutput(file);

            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "xitem-xitem_main_body";
            string content = "sample text file";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1);

            _validate.ClassName = "xitem_.en-xitem_main_body";
            content = "sample text file";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            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_main_body";
            _validate.ClassProperty.Add("fo:color", "#0000ff");
            bool returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);

            _validate.ClassName = "xitem_.en-xitem_main_body";
            _validate.ClassProperty.Add("fo:color", "#008000");
            returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);

        }
コード例 #25
0
        public void DropCap_Node()
        {
            const string file = "DropCap";
            _projInfo.ProjectInputType = "Scripture";

            string styleOutput = GetStyleOutput(file);

            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "ChapterNumber1";
            _validate.ChildClassName = "ChapterNumber_Paragraph_scrSection_scrBook_scrBody";
            _validate.ChildClassType = "span";
            string content = "1";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1);

            //Note - The Styles will be created while processing xhtml(content.xml)
            ////Style Test - Second
            _validate = new ValidateXMLFile(styleOutput);
            string xpath = "//style:style[@style:name='ChapterNumber1']";
            _validate.ClassName = string.Empty;
            string inner = "<style:paragraph-properties style:vertical-align=\"auto\" fo:float=\"left\" xmlns:fo=\"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0\" xmlns:style=\"urn:oasis:names:tc:opendocument:xmlns:style:1.0\">" +
            "<style:drop-cap style:lines=\"2\" style:distance=\"0.20cm\" style:length=\"1\" />" +
            "</style:paragraph-properties>";

            bool returnValue = _validate.ValidateNodeInnerXml(xpath, inner);
            Assert.IsTrue(returnValue);
        }
コード例 #26
0
        public void CounterPart_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "CounterPart";
            string styleOutput = GetStyleOutput(file);

            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "entry_letData_dicBody";
            _validate.GetInnerText = true;
            string content = "(sem. domains: counterparts.)";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1);
        }
コード例 #27
0
        public void SpanStyleTest_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "spanstyle";

            string styleOutput = GetStyleOutput(file);

            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "span_.tpi_definition_.en_sense_senses_entry_letData_dicBody";
            _validate.ClassNameTrim = false;
            string content = "spirit/ tewel em i lusim bodi long nait long driman";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1, "spacebefore - Content 1 Failure");

            //Note - The Styles will be created while processing xhtml(content.xml)
            //Style Test - Second
            _validate = new ValidateXMLFile(styleOutput);
            _validate.ClassName = "span_.tpi_definition_.en_sense_senses_entry_letData_dicBody";
            _validate.ClassProperty.Add("fo:color", "#0000ff");
            bool returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue, "spacebefore - Style Failure");
        }
コード例 #28
0
        public void HyphenationWordTest()
        {
            _projInfo.ProjectInputType = "Scripture";
            const string file = "HyphenationRuleLO";
            Param.HyphenEnable = true;
            string styleOutput = GetStyleOutput(file);

            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.GetInnerText = true;
            _validate.ClassName = "Paragraph_scrBook_scrBody";
			const string content = "17\n Epʉraꞌan awonsiꞌkɨ Tepiꞌ, kin pe teꞌsen pʉꞌkʉ pona, 14 kaisa rɨ itamokori ton uꞌtɨsaꞌ esiꞌpʉ mɨrɨ.";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1, "Hyphenation word test failure");
            Param.HyphenEnable = false;

        }
コード例 #29
0
        public void SpaceBeforeTest_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "spacebefore";

            //StyleXML
            string styleOutput = GetStyleOutput(file);
            //revSense_.bss_revEntry_revData
            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "revEntry_revData_revAppendix";
            _validate.ClassNameTrim = false;
            string content = "<text:span text:style-name=\"headword_.en_revEntry_revData_revAppendix\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\">??</text:span><text:span text:style-name=\"revSense_.bss_revEntry_revData_revAppendix\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\">booy</text:span><text:span text:style-name=\"revSense_.bss_revEntry_revData_revAppendix\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\">; the</text:span><text:span text:style-name=\"revSense_.bss_revEntry_revData_revAppendix\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\">; child</text:span><text:span text:style-name=\"revSense_.bss_revEntry_revData_revAppendix\" xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\">; went</text:span>";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "para");
            Assert.IsTrue(returnValue1, "spacebefore - Content 1 Failure");
        }
コード例 #30
0
        public void ClassNameValueTest_Node()
        {

            const string file = "ClassNameValueTest";
            _projInfo.ProjectInputType = "Dictionary";
            string styleOutput = GetStyleOutput(file);

            _validate = new ValidateXMLFile(styleOutput);
            _validate.ClassName = "letter.-current_locator_dictionary";

            _validate.ClassProperty.Add("fo:color", "#ff0000");
            _validate.ClassProperty.Add("fo:background-color", "#aaff00");
            bool returnValue = _validate.ValidateNodeAttributesNS(false);
            Assert.IsTrue(returnValue);

            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "letter.-current_locator_dictionary";
            string content = "w";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1);
        }
コード例 #31
0
        public void ReplacePrinceQuoteTest_Node()
        {
            _projInfo.ProjectInputType = "Dictionary";
            const string file = "ReplacePrinceQuote";
            string styleOutput = GetStyleOutput(file);

            //Content Test - First
            _validate = new ValidateXMLFile(_projInfo.TempOutputFolder);
            _validate.ClassName = "span_Line1_columns_scrBook_scrBody";
            _validate.ClassNameTrim = true;
            string content = "I Jerusalem, inau ku tutua sina ghahira kori hidigna na vathe.";
            bool returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1, "ReplacePrinceQuote - Content 1 Failure");

            _validate.ClassName = "span_Line2_columns_scrBook_scrBody";
            _validate.ClassNameTrim = true;
            content = "Ahai ke vaututunia, imanea teo keda toatogha ke boi toke ke vaututunia.";
            returnValue1 = _validate.ValidateOfficeTextNode(content, "span");
            Assert.IsTrue(returnValue1, "ReplacePrinceQuote - Content 2 Failure");
        }