public virtual void testInvalidNameSpace() { JDFDoc doc = new JDFDoc("JDF"); JDFElement e = doc.getJDFRoot(); string s = JDFConstants.JDFNAMESPACE; s = StringUtil.replaceString(s, "_1_1", "_1_3"); JDFElement e2 = (JDFElement)e.appendElement("ResourcePool", s); Assert.IsTrue(e2.getInvalidAttributes(EnumValidationLevel.Incomplete, true, 9999).Contains("xmlns")); e2 = (JDFElement)e.appendElement("ResourceLinkPool", "www.cip4.org"); Assert.IsTrue(e2.getInvalidAttributes(EnumValidationLevel.Incomplete, true, 9999).Contains("xmlns")); }
public virtual void testGetParentJDFStatic() { JDFDoc d = new JDFDoc("JDF"); JDFElement root = d.getJDFRoot(); Assert.IsNull(JDFElement.getParentJDF(root)); Assert.IsNull(JDFElement.getParentJDF(null)); KElement k = root.appendElement("NodeInfo"); Assert.AreEqual(root, JDFElement.getParentJDF(k)); k = k.appendElement("foo:Bar", "www.foo.com"); Assert.AreEqual(root, JDFElement.getParentJDF(k)); k = root.appendElement("JDF"); Assert.AreEqual(root, JDFElement.getParentJDF(k)); }
public virtual void testAppendAnchor() { JDFDoc doc = new JDFDoc("JDF"); JDFElement e = doc.getJDFRoot(); SupportClass.HashSetSupport m = new SupportClass.HashSetSupport(); KElement e2 = e.appendElement("e2"); // Java to C# Conversion - Divide number of tests by 1000 for now for (int i = 0; i < 10; i++) { JDFElement appendElement = (JDFElement)e2.appendElement("FooBar"); string s = appendElement.appendAnchor(null); if (m.Contains(s)) { Assert.Fail("oops"); } Assert.AreEqual(s, appendElement.getID()); Assert.IsTrue(s.IndexOf("..") < 0); m.Add(s); } }