Example #1
0
        public virtual void testIncludesMatchingAttribute()
        {
            _setUp();

            Assert.IsTrue(m_jdfElement.includesMatchingAttribute("Range", "600 800", AttributeInfo.EnumAttributeType.XYPairRangeList), "isInside (600 800) = ");
            Assert.IsFalse(m_jdfElement.includesMatchingAttribute("Range", "500 700", AttributeInfo.EnumAttributeType.XYPairRangeList), "isOutside(500 700) = ");

            JDFDoc     d = new JDFDoc("JDF");
            JDFElement e = d.getJDFRoot();

            e.setAttribute("abc", "a b c");
            Assert.IsTrue(e.includesMatchingAttribute("abc", "a", EnumAttributeType.NMTOKENS), "b");
            Assert.IsTrue(e.includesMatchingAttribute("abc", "b", EnumAttributeType.NMTOKENS), "b");
            Assert.IsTrue(e.includesMatchingAttribute("abc", "c", EnumAttributeType.NMTOKENS), "b");
            Assert.IsFalse(e.includesMatchingAttribute("abc", "d", EnumAttributeType.NMTOKENS), "b");
            e.setAttribute("intlist", "-1 3 5");
            Assert.IsTrue(e.includesMatchingAttribute("intlist", "-1", EnumAttributeType.IntegerList));
            Assert.IsTrue(e.includesMatchingAttribute("intlist", "3", EnumAttributeType.IntegerList));
            Assert.IsTrue(e.includesMatchingAttribute("intlist", "5", EnumAttributeType.IntegerList));
            Assert.IsFalse(e.includesMatchingAttribute("intlist", "4", EnumAttributeType.IntegerList));
            Assert.IsFalse(e.includesMatchingAttribute("intlist", "8", EnumAttributeType.IntegerList));
        }