Пример #1
0
        public override void setUp()
        {
            base.setUp();
            JDFDoc doc = new JDFDoc("DurationState");

            iState = (JDFDurationState)doc.getRoot();
        }
Пример #2
0
        public virtual void testGetDurationState()
        {
            JDFDoc           d  = new JDFDoc("DevCap");
            JDFDevCap        dc = (JDFDevCap)d.getRoot();
            JDFDurationState ds = dc.appendDurationState("foo");

            Assert.AreEqual("foo", ds.getName());
            ds = dc.getDurationState("bar");
            Assert.IsNull(ds);
            ds = dc.getCreateDurationState("bar");
            Assert.IsNotNull(ds);
            Assert.AreEqual("bar", ds.getName());
            ds = dc.getDurationState("bar");
            Assert.IsNotNull(ds);
            Assert.AreEqual("bar", ds.getName());
        }
Пример #3
0
        public void testFitsValue()
        {
            JDFParser p       = new JDFParser();
            string    strNode = "<DurationState Name=\"BitDepth\" DefaultValue=\"PT1H\" AllowedValueList=\"PT1H~PT4H30M5S\"/>";

            JDFDoc           jdfDoc = p.parseString(strNode);
            JDFDurationState state  = (JDFDurationState)jdfDoc.getRoot();

            state.setListType(EnumListType.SingleValue);
            Assert.IsTrue(state.fitsValue("PT2H", EnumFitsValue.Allowed), "ListType=SingleValue");
            Assert.IsFalse(state.fitsValue("PT6H", EnumFitsValue.Allowed), "ListType=SingleValue");

            state.removeAttribute(AttributeName.ALLOWEDVALUELIST);
            Assert.IsTrue(state.fitsValue("PT2H", EnumFitsValue.Allowed), "ListType=SingleValue");
            Assert.IsTrue(state.fitsValue("PT6H", EnumFitsValue.Allowed), "ListType=SingleValue");
        }