Exemple #1
0
        public virtual void testAddAll()
        {
            VString v = new VString();

            v.Add("a");
            v.Add("b");
            v.Add("c");
            v.Add("c");
            string[] h = { "c", "b", "a", "d" };
            v.unify();
            Assert.AreEqual("a b c", StringUtil.setvString(v, " ", null, null), "a b c");
            v.addAll(h);
            v.unify();
            Assert.AreEqual("a b c d", StringUtil.setvString(v, " ", null, null), "a b c d");
        }
Exemple #2
0
        public virtual void testUnify()
        {
            VString v = new VString();

            v.Add("a");
            v.Add("b");
            v.Add("c");
            v.Add("c");
            VString w = new VString();

            w.Add("c");
            w.Add("b");
            w.Add("a");
            w.Add("a");
            w.Add("d");

            v.unify();
            Assert.AreEqual("a b c", StringUtil.setvString(v, " ", null, null), "a b c");
            v.appendUnique(w);
            Assert.AreEqual("a b c d", StringUtil.setvString(v, " ", null, null), "a b c d");
        }
Exemple #3
0
        public virtual void testGetCombinedProcessTypes()
        {
            JDFDoc  d = new JDFDoc(ElementName.JDF);
            JDFNode n = d.getJDFRoot();

            n.setType("Combined", true);
            n.setTypes(new VString("a b c d e f e f", " "));
            JDFResource     r         = n.addResource(ElementName.ADHESIVEBINDINGPARAMS, EnumUsage.Input);
            JDFResourceLink rl        = n.getLink(r, null);
            VString         nodeTypes = n.getTypes();

            nodeTypes.unify();
            CollectionAssert.AreEqual(nodeTypes, rl.getCombinedProcessTypes());
            rl.setCombinedProcessType("c");
            CollectionAssert.AreEqual(new VString("c", " "), rl.getCombinedProcessTypes());
            rl.removeAttribute(AttributeName.COMBINEDPROCESSTYPE);
            CollectionAssert.AreEqual(nodeTypes, rl.getCombinedProcessTypes());
            rl.setCombinedProcessIndex(new JDFIntegerList("0 2 4 6"));
            CollectionAssert.AreEqual(new VString("a c e", " "), rl.getCombinedProcessTypes());
            rl.setCombinedProcessIndex(new JDFIntegerList("0 2 4 6 8 99"));
            CollectionAssert.AreEqual(new VString("a c e", " "), rl.getCombinedProcessTypes());
        }