public virtual void FieldWithValueUnitTest()
        {
            XmlDocument document = XfdfFileUtils.CreateNewXfdfDocument();
            XmlElement  fields   = document.CreateElement("fields");

            document.AppendChild(fields);
            FieldObject fieldObject = new FieldObject();

            fieldObject.SetName("testname");
            fieldObject.SetValue("testValue");
            IList <FieldObject> fieldList = new List <FieldObject>();

            XfdfWriter.AddField(fieldObject, fields, document, fieldList);
            XmlNode childOfFields = fields.FirstChild;

            NUnit.Framework.Assert.IsNotNull(childOfFields);
            NUnit.Framework.Assert.AreEqual("value", childOfFields.FirstChild.Name);
            NUnit.Framework.Assert.AreEqual("testValue", childOfFields.FirstChild.InnerText);
        }
示例#2
0
 /// <summary>Adds a new field to the list.</summary>
 /// <param name="field">FieldObject containing the info about the form field.</param>
 public virtual iText.Forms.Xfdf.FieldsObject AddField(FieldObject field)
 {
     this.fieldList.Add(field);
     return(this);
 }