Exemple #1
0
        public virtual void testGetModuleAvailability()
        {
            JDFDoc       d         = new JDFDoc("DeviceCap");
            JDFDeviceCap deviceCap = (JDFDeviceCap)d.getRoot();
            JDFModuleCap mc        = deviceCap.appendModulePool().appendModuleCap();

            mc.setID("i");
            mc.setAvailability(EnumAvailability.NotLicensed);
            JDFDevCap dc = deviceCap.appendDevCaps().appendDevCap();

            Assert.AreEqual(EnumAvailability.Installed, dc.getModuleAvailability());
            dc.setAvailability(EnumAvailability.Module);
            Assert.AreEqual(EnumAvailability.Module, dc.getAvailability());
            Assert.IsNull(dc.getModuleAvailability());
            dc.setModuleRefs(new VString("i", null));
            Assert.AreEqual(EnumAvailability.NotLicensed, dc.getModuleAvailability());
        }
Exemple #2
0
        public virtual void testGetMinAvailability()
        {
            JDFDoc        d  = new JDFDoc(ElementName.MODULEPOOL);
            JDFModulePool mp = (JDFModulePool)d.getRoot();

            for (int i = 0; i < 4; i++)
            {
                JDFModuleCap mc = mp.appendModuleCap();
                mc.setID("I" + i);
                mc.setAvailability(EnumAvailability.getEnum(i));
            }
            VString s = new VString();

            for (int i = 3; i >= 0; i--)
            {
                s.Add("I" + i);
                Assert.AreEqual(EnumAvailability.getEnum(i), mp.getMinAvailability(s));
            }
        }