Ejemplo n.º 1
0
        public virtual void testStateReportRequired()
        {
            JDFDoc    d  = new JDFDoc("DevCap");
            JDFDevCap dc = (JDFDevCap)d.getRoot();

            dc.setName("foo");
            JDFIntegerState @is = dc.appendIntegerState();

            @is.setName("bar1");
            @is.setRequired(true);
            JDFIntegerState is2 = dc.appendIntegerState();

            is2.setName("bar2");
            is2.setRequired(false);

            JDFDoc   d2  = new JDFDoc("foo");
            KElement foo = d2.getRoot();

            JDFDoc   d3     = new JDFDoc("parent");
            KElement parent = d3.getRoot();

            dc.stateReport(foo, EnumFitsValue.Allowed, EnumValidationLevel.Complete, false, true, parent);
            Assert.IsTrue(parent.ToString().IndexOf("bar1") >= 0);
            Assert.IsFalse(parent.ToString().IndexOf("bar2") >= 0);
        }