Ejemplo n.º 1
0
        public void PathPointTypeTest2()
        {
            ClearFiles();
            _spreadXML   = new InSpread();
            _methodName  = "PathPointTypeTest2";
            _cssProperty = _cssTree.CreateCssProperty(_inputCSS2, true);
            _idAllClass  = _stylesXML.CreateIDStyles(_outputStyles, _cssProperty);
            _spreadXML.CreateIDSpread(_outputSpread, _idAllClass, _columnClass);
            _xPath            = "//TextFrame[@Self=\"TF2\"]/Properties/PathGeometry/GeometryPathType/PathPointArray/PathPointType";
            _fileNameWithPath = Common.PathCombine(_outputSpread, "Spread_1.xml");
            nodesList         = Common.GetXmlNodeListInDesignNamespace(_fileNameWithPath, _xPath);
            XmlNode node = nodesList[0];
            XmlAttributeCollection attrb = node.Attributes;

            string result = attrb["Anchor"].Value;

            // "-198 -324"
            Assert.AreEqual(result, "-270 -325", _methodName + " failed for Anchor");

            result = attrb["LeftDirection"].Value;
            Assert.AreEqual(result, "-270 -325", _methodName + " failed for LeftDirection");

            result = attrb["RightDirection"].Value;
            Assert.AreEqual(result, "-270 -325", _methodName + " failed for RightDirection");
        }
Ejemplo n.º 2
0
        public void MarginPreferenceTest()
        {
            ClearFiles();
            _spreadXML   = new InSpread();
            _methodName  = "MarginPreferenceTest";
            _cssProperty = _cssTree.CreateCssProperty(_inputCSS2, true);
            _idAllClass  = _stylesXML.CreateIDStyles(_outputStyles, _cssProperty);
            _spreadXML.CreateIDSpread(_outputSpread, _idAllClass, _columnClass);
            _xPath            = "//MarginPreference";
            _fileNameWithPath = Common.PathCombine(_outputSpread, "Spread_2.xml");
            XmlNode node = Common.GetXmlNodeInDesignNamespace(_fileNameWithPath, _xPath);
            XmlAttributeCollection attrb = node.Attributes;
            string result = attrb["Top"].Value;

            Assert.AreEqual(result, "36", _methodName + " failed for Margin_Top");

            result = attrb["Right"].Value;
            Assert.AreEqual(result, "72", _methodName + " failed for Margin_Top");

            result = attrb["Bottom"].Value;
            Assert.AreEqual(result, "108", _methodName + " failed for Margin_Top");

            result = attrb["Left"].Value;
            Assert.AreEqual(result, "144", _methodName + " failed for Margin_Top");
        }
Ejemplo n.º 3
0
 public void PathPointTypeTest1()
 {
     ClearFiles();
     _spreadXML   = new InSpread();
     _methodName  = "PathPointTypeTest1";
     _cssProperty = _cssTree.CreateCssProperty(_inputCSS2, true);
     _idAllClass  = _stylesXML.CreateIDStyles(_outputStyles, _cssProperty);
     _spreadXML.CreateIDSpread(_outputSpread, _idAllClass, _columnClass);
     _xPath            = "//TextFrame[@Self=\"TF2\"]/Properties/PathGeometry/GeometryPathType/PathPointArray/PathPointType";
     _fileNameWithPath = Common.PathCombine(_outputSpread, "Spread_1.xml");
     nodesList         = Common.GetXmlNodeListInDesignNamespace(_fileNameWithPath, _xPath);
     Assert.IsTrue(nodesList.Count == 4, _methodName + " failed");
 }
Ejemplo n.º 4
0
 public void PageCountTest()
 {
     ClearFiles();
     _spreadXML   = new InSpread();
     _methodName  = "PageCountTest";
     _cssProperty = _cssTree.CreateCssProperty(_inputCSS2, true);
     _idAllClass  = _stylesXML.CreateIDStyles(_outputStyles, _cssProperty);
     _spreadXML.CreateIDSpread(_outputSpread, _idAllClass, _columnClass);
     _xPath            = "//Page";
     _fileNameWithPath = Common.PathCombine(_outputSpread, "Spread_2.xml");
     nodesList         = Common.GetXmlNodeListInDesignNamespace(_fileNameWithPath, _xPath);
     Assert.IsTrue(nodesList.Count == 2, _methodName + " failed");
 }
Ejemplo n.º 5
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");
     }
 }
Ejemplo n.º 6
0
        public void TextFrameNameTest()
        {
            ClearFiles();
            _spreadXML   = new InSpread();
            _methodName  = "TextFrameNameTest";
            _cssProperty = _cssTree.CreateCssProperty(_inputCSS1, true);
            _idAllClass  = _stylesXML.CreateIDStyles(_outputStyles, _cssProperty);
            _spreadXML.CreateIDSpread(_outputSpread, _idAllClass, _columnClass);
            _xPath            = "//TextFrame";
            _fileNameWithPath = Common.PathCombine(_outputSpread, "Spread_1.xml");
            XmlNode node = Common.GetXmlNodeInDesignNamespace(_fileNameWithPath, _xPath);
            XmlAttributeCollection attrb = node.Attributes;
            string result = attrb["Self"].Value;

            Assert.AreEqual(result, "TF1", _methodName + " failed");
        }
Ejemplo n.º 7
0
        public void ColumnGap()
        {
            ClearFiles();
            _spreadXML   = new InSpread();
            _inputXHTML  = Common.DirectoryPathReplace(_testFolderPath + "/input/ColumnGap1.xhtml");
            _inputCSS    = Common.DirectoryPathReplace(_testFolderPath + "/input/ColumnGap1.css");
            _cssProperty = _cssTree.CreateCssProperty(_inputCSS, true);
            _idAllClass  = _stylesXML.CreateIDStyles(_outputStyles, _cssProperty);
            projInfo.DefaultXhtmlFileWithPath = _inputXHTML;
            _storyXML.CreateStory(projInfo, _idAllClass, _cssTree.SpecificityClass, _cssTree.CssClassOrder);
            _spreadXML.CreateIDSpread(_outputSpread, _idAllClass, _columnClass);
            _xPath            = "//TextFrame[@Self=\"TF2\"]/TextFramePreference";
            _fileNameWithPath = Common.PathCombine(_outputSpread, "Spread_1.xml");
            nodesList         = Common.GetXmlNodeListInDesignNamespace(_fileNameWithPath, _xPath);
            XmlNode node = nodesList[0];
            XmlAttributeCollection attrb = node.Attributes;

            string result = attrb["TextColumnGutter"].Value;

            Assert.AreEqual(result, "50", _methodName);
        }