Ejemplo n.º 1
0
 public void AddFieldObject_ToRowObject_IsNotLocked()
 {
     RowObject rowObject1 = new RowObject();
     RowObject rowObject2 = new RowObject();
     rowObject1 = (RowObject)OptionObjectHelpers.AddFieldObject(rowObject1, "1", "Test", "0", "0", "0");
     rowObject2 = (RowObject)OptionObjectHelpers.AddFieldObject(rowObject2, "1", "Test", false, false, false);
     Assert.IsFalse(rowObject1.IsFieldLocked("1"));
     Assert.IsFalse(rowObject2.IsFieldLocked("1"));
 }
Ejemplo n.º 2
0
 public void AddFieldObject_ToRowObject_IsLocked()
 {
     RowObject rowObject1 = new RowObject();
     RowObject rowObject2 = new RowObject();
     rowObject1 = (RowObject)OptionObjectHelpers.AddFieldObject(rowObject1, "1", "Test", "1", "1", "1");
     rowObject2 = (RowObject)OptionObjectHelpers.AddFieldObject(rowObject2, "1", "Test", true, true, true);
     Assert.IsTrue(rowObject1.IsFieldLocked("1"));
     Assert.IsTrue(rowObject2.IsFieldLocked("1"));
 }
Ejemplo n.º 3
0
 public void AddFieldObject_ToRowObject_BlankFieldNumber()
 {
     string expectedNumber = "";
     string expectedValue = "Test";
     RowObject rowObject = new RowObject();
     rowObject = (RowObject)OptionObjectHelpers.AddFieldObject(rowObject, expectedNumber, expectedValue);
     Assert.IsTrue(rowObject.IsFieldPresent(expectedNumber));
     Assert.AreEqual(expectedValue, rowObject.GetFieldValue(expectedNumber));
 }
Ejemplo n.º 4
0
 public void AddFieldObject_ToRowObject_Succeeds()
 {
     FieldObject fieldObject = new FieldObject()
     {
         FieldNumber = "1",
         FieldValue = "Test",
         Enabled = "1",
         Required = "0",
         Lock = "0"
     };
     RowObject rowObject = new RowObject();
     rowObject = (RowObject)OptionObjectHelpers.AddFieldObject(rowObject, fieldObject);
     Assert.IsTrue(rowObject.IsFieldPresent("1"));
 }
Ejemplo n.º 5
0
 public void AddFieldObject_ToRowObject_NullRowObject()
 {
     FieldObject fieldObject = new FieldObject()
     {
         FieldNumber = "1",
         FieldValue = "Test",
         Enabled = "1",
         Required = "0",
         Lock = "0"
     };
     RowObject rowObject = null;
     rowObject = (RowObject)OptionObjectHelpers.AddFieldObject(rowObject, fieldObject);
     Assert.AreNotEqual(null, fieldObject);
 }
Ejemplo n.º 6
0
 public void AddFieldObject_ToRowObject_DuplicateFieldNumber()
 {
     FieldObject fieldObject1 = new FieldObject()
     {
         FieldNumber = "1",
         FieldValue = "Test",
         Enabled = "1",
         Required = "0",
         Lock = "0"
     };
     FieldObject fieldObject2 = new FieldObject()
     {
         FieldNumber = "1",
         FieldValue = "Test 2",
         Enabled = "1",
         Required = "0",
         Lock = "0"
     };
     RowObject rowObject = new RowObject();
     rowObject = (RowObject)OptionObjectHelpers.AddFieldObject(rowObject, fieldObject1);
     rowObject = (RowObject)OptionObjectHelpers.AddFieldObject(rowObject, fieldObject2);
     Assert.IsFalse(rowObject.IsFieldPresent("1"));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Adds a <see cref="FieldObject"/> to a <see cref="RowObject"/> with the provided property values.
 /// </summary>
 /// <param name="fieldNumber">A <see cref="string"/> containing the <see cref="FieldObject.FieldNumber"/> of the <see cref="FieldObject"/>.</param>
 /// <param name="fieldValue">A <see cref="string"/> containing the <see cref="FieldObject.FieldValue"/> of the <see cref="FieldObject"/>.</param>
 /// <param name="enabled">A <see cref="bool"/> containing the <see cref="FieldObject.Enabled"/> of the <see cref="FieldObject"/>.</param>
 /// <param name="locked">A <see cref="bool"/> containing the <see cref="FieldObject.Lock"/> of the <see cref="FieldObject"/>.</param>
 /// <param name="required">A <see cref="bool"/> containing the <see cref="FieldObject.Required"/> of the <see cref="FieldObject"/>.</param>
 public void AddFieldObject(string fieldNumber, string fieldValue, bool enabled, bool locked, bool required) => this.Fields = OptionObjectHelpers.AddFieldObject(this, fieldNumber, fieldValue, enabled, locked, required).Fields;
Ejemplo n.º 8
0
 /// <summary>
 /// Adds a <see cref="FieldObject"/> to a <see cref="RowObject"/> with the provided property values.
 /// </summary>
 /// <param name="fieldNumber">A <see cref="string"/> containing the <see cref="FieldObject.FieldNumber"/> of the <see cref="FieldObject"/>.</param>
 /// <param name="fieldValue">A <see cref="string"/> containing the <see cref="FieldObject.FieldValue"/> of the <see cref="FieldObject"/>.</param>
 /// <param name="enabledValue">A <see cref="string"/> containing the <see cref="FieldObject.Enabled"/> of the <see cref="FieldObject"/>.</param>
 /// <param name="lockedValue">A <see cref="string"/> containing the <see cref="FieldObject.Lock"/> of the <see cref="FieldObject"/>.</param>
 /// <param name="requiredValue">A <see cref="string"/> containing the <see cref="FieldObject.Required"/> of the <see cref="FieldObject"/>.</param>
 public void AddFieldObject(string fieldNumber, string fieldValue, string enabledValue, string lockedValue, string requiredValue) => this.Fields = OptionObjectHelpers.AddFieldObject(this, fieldNumber, fieldValue, enabledValue, lockedValue, requiredValue).Fields;
Ejemplo n.º 9
0
 /// <summary>
 /// Adds a <see cref="FieldObject"/> to a <see cref="RowObject"/> with the provided <see cref="FieldObject.FieldNumber"/> and <see cref="FieldObject.FieldValue"/>.
 /// </summary>
 /// <param name="fieldNumber">A <see cref="string"/> containing the <see cref="FieldObject.FieldNumber"/> of the <see cref="FieldObject"/>.</param>
 /// <param name="fieldValue">A <see cref="string"/> containing the <see cref="FieldObject.FieldValue"/> of the <see cref="FieldObject"/>.</param>
 public void AddFieldObject(string fieldNumber, string fieldValue) => this.Fields = OptionObjectHelpers.AddFieldObject(this, fieldNumber, fieldValue).Fields;
Ejemplo n.º 10
0
        //
        // IRowObject Methods
        //

        /// <summary>
        /// Adds a <see cref="FieldObject"/> to a <see cref="RowObject"/>.
        /// </summary>
        /// <param name="fieldObject"></param>
        public void AddFieldObject(FieldObject fieldObject) => this.Fields = OptionObjectHelpers.AddFieldObject(this, fieldObject).Fields;
Ejemplo n.º 11
0
 public void AddFieldObject_ToRowObject_NullFieldObject()
 {
     RowObject rowObject = new RowObject();
     rowObject = (RowObject)OptionObjectHelpers.AddFieldObject(rowObject, null);
     Assert.AreNotEqual(rowObject, null);
 }