Example #1
0
        public void Visibility()
        {
            string _inputXHTML = Common.DirectoryPathReplace(_testFolderPath + "/input/Visibility.xhtml");
            string _inputCSS   = Common.DirectoryPathReplace(_testFolderPath + "/input/Visibility.css");

            _cssProperty = _cssTree.CreateCssProperty(_inputCSS, true);
            _idAllClass  = _stylesXML.CreateIDStyles(_outputStyles, _cssProperty);
            projInfo.DefaultXhtmlFileWithPath = _inputXHTML;
            _storyXML.CreateStory(projInfo, _idAllClass, _cssTree.SpecificityClass, _cssTree.CssClassOrder);
            const string classname = "a_1";

            XPath = "//RootParagraphStyleGroup/ParagraphStyle[@Name = \"" + classname + "\"]";
            string                 fileNameWithPath = Common.PathCombine(_outputStyles, "Styles.xml");
            XmlNodeList            nodesList        = Common.GetXmlNodeListInDesignNamespace(fileNameWithPath, XPath);
            XmlNode                node             = nodesList[0];
            XmlAttributeCollection attrb            = node.Attributes;
            string                 result           = attrb["FillColor"].Value;

            Assert.AreEqual("Color/Paper", result, classname + " test Failed");
        }
Example #2
0
        private bool NodeListCompare()
        {
            _cssProperty = _cssTree.CreateCssProperty(_inputCSS, true);
            _idAllClass  = _stylesXML.CreateIDStyles(_outputStyles, _cssProperty);
            var       inMasterSpread  = new InMasterSpread();
            var       masterPageNames = inMasterSpread.CreateIDMasterSpread(_outputMasterSpreads, _idAllClass, headwordStyles);
            ArrayList test            = new ArrayList();

            _designmapXML.CreateIDDesignMap(_outputPath, 4, masterPageNames, test, new ArrayList(), string.Empty);
            FileNameWithPath = Common.PathCombine(_outputPath, "designmap.xml");
            var result1 = Common.GetXmlNodeListInDesignNamespace(FileNameWithPath, XPath);

            foreach (XmlNode fileName in result1)
            {
                if (_expectedList.Contains(fileName))
                {
                    return(false);
                }
            }
            return(true);
        }
Example #3
0
 private void NodeTest(bool checkAttribute)
 {
     _cssProperty = _cssTree.CreateCssProperty(_input, true);
     _stylesXML.CreateIDStyles(_output, _cssProperty);
     FileNameWithPath = Common.PathCombine(_output, "Styles.xml");
     if (checkAttribute)
     {
         Assert.IsTrue(ValidateNodeAttribute(), _input + " test Failed");
     }
     else
     {
         Assert.IsTrue(ValidateNodeValue(), _input + " test Failed");
     }
 }
Example #4
0
        public void PreferenceDocumentTagTest()
        {
            const string _methodName = "PreferenceDocumentTagTest";

            _inputCSSWithFileName = Common.DirectoryPathReplace(_testFolderPath + "/input/Page1.css");
            _cssProperty          = _cssTree.CreateCssProperty(_inputCSSWithFileName, true);
            _idAllClass           = _stylesXML.CreateIDStyles(_outputResourcePath, _cssProperty);
            CreateIDPreferences(_outputResourcePath, _idAllClass);
            _fileNameWithPath = Common.PathCombine(_outputResourcePath, "Preferences.xml");
            _xPath            = "//DocumentPreference";

            XmlNode node = Common.GetXmlNodeInDesignNamespace(_fileNameWithPath, _xPath);
            XmlAttributeCollection attrb = node.Attributes;
            string result = attrb["PageHeight"].Value;

            Assert.AreEqual(result, "792", _methodName + " failed");

            _xPath = "//DocumentPreference[@PageWidth = \"612\"]";
            node   = Common.GetXmlNodeInDesignNamespace(_fileNameWithPath, _xPath);
            attrb  = node.Attributes;
            result = attrb["PageWidth"].Value;
            Assert.AreEqual(result, "612", _methodName + " failed");
        }
Example #5
0
        public void MasterPageCount()
        {
            ClearFiles();
            _methodName  = "MasterPageCount";
            _cssProperty = _cssTree.CreateCssProperty(_inputCSS1, true);
            _idAllClass  = _stylesXML.CreateIDStyles(_outputStyle, _cssProperty);

            _masterSpreadXML.CreateIDMasterSpread(_outputSpread, _idAllClass, headwordStyles);
            for (int i = 0; i < _listofMasterPages.Count - 1; i++)
            {
                string fileWithPath = Common.PathCombine(_outputSpread, _listofMasterPages[i].ToString());
                bool   result       = File.Exists(fileWithPath);
                Assert.IsTrue(result, fileWithPath + " is missing");
            }
        }
Example #6
0
 public void SpreadListTest1()
 {
     ClearFiles();
     _spreadXML   = new InSpread();
     _methodName  = "SpreadListTest1";
     _cssProperty = _cssTree.CreateCssProperty(_inputCSS1, true);
     _idAllClass  = _stylesXML.CreateIDStyles(_outputStyles, _cssProperty);
     _spreadXML.CreateIDSpread(_outputSpread, _idAllClass, _columnClass);
     for (int i = 0; i < _facingPages.Count; i++)
     {
         string fileWithPath = Common.PathCombine(_outputSpread, _facingPages[i].ToString());
         bool   result       = File.Exists(fileWithPath);
         Assert.IsTrue(result, fileWithPath + " is missing");
     }
 }