コード例 #1
0
        public virtual void testSetString()
        {
            JDFDoc  d = new JDFDoc("JDF");
            JDFNode n = d.getJDFRoot();

            JDFMatrix m = new JDFMatrix("1 0 0 1 0 0");

            Assert.AreEqual(JDFMatrix.unitMatrix, m);
            n.setAttribute("foo", m, null);
            Assert.AreEqual(n.getAttribute("foo"), m.ToString());
        }
コード例 #2
0
ファイル: JDFElementTest.cs プロジェクト: cip4/JDFLibNet
        public virtual void testFixVersion()
        {
            JDFDoc  d = new JDFDoc("JDF");
            JDFNode n = d.getJDFRoot();

            n.setType(EnumType.Bundling);
            JDFProcessRun pr = n.getAuditPool().addProcessRun(EnumNodeStatus.Completed, null, null);

            pr.setAttribute("Duration", "PT90S", null);
            Assert.AreEqual("PT90S", pr.getAttribute("Duration"));
            n.setAttribute("foo3", "a~.doc");
            n.fixVersion(null);
            Assert.AreEqual("PT1M30S", pr.getAttribute("Duration"));
            Assert.AreEqual("a~.doc", n.getAttribute("foo3"));
        }
コード例 #3
0
ファイル: JDFXYPairTest.cs プロジェクト: cip4/JDFLibNet
        public void testSetString()
        {
            JDFDoc  doc = new JDFDoc("JDF");
            JDFNode n   = doc.getJDFRoot();

            JDFXYPair xy = new JDFXYPair("1 2");

            n.setAttribute("test", xy, null);

            xy = new JDFXYPair("1.1 2.2");
            n.setAttribute("test2", xy, null);
            Assert.AreEqual("1.1 2.2", n.getAttribute("test2", null, ""), "double double");

            try
            {
                new JDFXYPair("1 2 3");
            }
            catch (FormatException)
            {
                Assert.IsTrue(true, "exception 123 caught");
            }
        }