public virtual void testGetUsage() { JDFDoc d = new JDFDoc(ElementName.JDF); JDFNode n = d.getJDFRoot(); JDFResourceLinkPool rlp = n.appendResourceLinkPool(); JDFResourceLink rl = (JDFResourceLink)rlp.appendElement("FooLink"); Assert.IsNull(rl.getUsage()); }
public virtual void testValidName() { JDFDoc d = new JDFDoc(ElementName.JDF); JDFNode n = d.getJDFRoot(); JDFResourceLinkPool rlp = n.appendResourceLinkPool(); JDFResourceLink rl = (JDFResourceLink)rlp.appendElement("FooLink"); JDFResource rBar = n.addResource("Bar", EnumResourceClass.Parameter, EnumUsage.Input, null, null, null, null); rl.setrRef(rBar.getID()); Assert.IsFalse((rl.isValid(null))); rl = n.getLink(rBar, null); Assert.IsNotNull(rl); Assert.IsTrue((rl.isValid(null))); }
public virtual void testSetAmountPoolAttribute() { JDFDoc d = new JDFDoc("ResourceLinkPool"); JDFResourceLinkPool rlp = (JDFResourceLinkPool)d.getRoot(); JDFResourceLink foo = (JDFResourceLink)rlp.appendElement("FooLink"); VJDFAttributeMap vPart = new VJDFAttributeMap(); vPart.Add(new JDFAttributeMap()); foo.setAmountPoolAttribute("blub", "123", null, vPart); Assert.AreEqual("123", foo.getAttribute("blub")); vPart = new VJDFAttributeMap(); JDFAttributeMap map = new JDFAttributeMap("SheetName", "b"); vPart.Add(map); foo.setAmountPoolAttribute("blub", "123", null, vPart); Assert.IsNull(foo.getAttribute("blub", null, null)); Assert.AreEqual("123", foo.getAmountPoolAttribute("blub", null, map, 0)); }