Example #1
0
        public virtual void testAddCreated()
        {
            // Test AddCreated with one parameter
            myAuditPool.addCreated("A_Test_Author", null);
            JDFAudit myAudit = myAuditPool.getAudit(1, JDFAudit.EnumAuditType.Created, new JDFAttributeMap(), null);
            string   myText  = myAudit.getAuthor();

            Assert.AreEqual("A_Test_Author", myText, "Error: Author should be \"A_Test_Author\"");
            // Test AddCreate with two Parameter

            // Get Create a ResourcePool
            JDFResourcePool myResourcePool = jdfRoot.getCreateResourcePool();

            // Append a ResoureElement
            myResourcePool.appendElement("BindingIntent", "");

            // Get that element back
            JDFResource e = (JDFResource)myResourcePool.getElement("BindingIntent", "", 0);

            myAuditPool.addCreated("A Test Author for JUnitTest 2", e);

            string     strResourceID  = e.buildXPath("/JDF", 1);
            JDFCreated kResourceAudit = (JDFCreated)myAuditPool.getChildWithAttribute(null, "XPath", null, strResourceID, 0, true);

            Assert.IsNotNull(kResourceAudit, "Error: Audit not found ");
        }