Ejemplo n.º 1
0
        public void DisableAllFieldObjects_Helpers_OptionObject2015_Null()
        {
            OptionObject2015 optionObject = null;

            OptionObjectHelpers.DisableAllFieldObjects(optionObject);
            Assert.IsTrue(optionObject.IsFieldEnabled("123"));
        }
Ejemplo n.º 2
0
        public void DisableAllFieldObjects_OptionObject2015_IsModified()
        {
            FieldObject fieldObject1 = new FieldObject()
            {
                FieldNumber = "1", FieldValue = "1"
            };
            FieldObject fieldObject2 = new FieldObject()
            {
                FieldNumber = "2", FieldValue = "2"
            };
            FieldObject fieldObject3 = new FieldObject()
            {
                FieldNumber = "3", FieldValue = "3"
            };
            FieldObject fieldObject4 = new FieldObject()
            {
                FieldNumber = "4", FieldValue = "4"
            };
            FieldObject fieldObject5 = new FieldObject()
            {
                FieldNumber = "5", FieldValue = "5"
            };
            List <FieldObject> fieldObjects = new List <FieldObject>
            {
                fieldObject1,
                fieldObject2,
                fieldObject3,
                fieldObject4,
                fieldObject5
            };
            RowObject         rowObject   = new RowObject("1||1", fieldObjects);
            FormObject        formObject  = new FormObject("1", rowObject);
            List <FormObject> formObjects = new List <FormObject>
            {
                formObject
            };
            OptionObject2015 optionObject2015 = new OptionObject2015()
            {
                Forms = formObjects
            };

            OptionObject2015 returnOptionObject = (OptionObject2015)OptionObjectHelpers.DisableAllFieldObjects(optionObject2015);

            Assert.IsTrue(returnOptionObject.IsFieldModified("1"));
            Assert.IsTrue(returnOptionObject.IsFieldModified("2"));
            Assert.IsTrue(returnOptionObject.IsFieldModified("3"));
            Assert.IsTrue(returnOptionObject.IsFieldModified("4"));
            Assert.IsTrue(returnOptionObject.IsFieldModified("5"));
        }
Ejemplo n.º 3
0
        public void DisableAllFieldObjects_OptionObject2015_ExcludesFields()
        {
            FieldObject        fieldObject1 = new FieldObject("1", "1", true, false, false);
            FieldObject        fieldObject2 = new FieldObject("2", "2", true, false, false);
            FieldObject        fieldObject3 = new FieldObject("3", "3", true, false, false);
            FieldObject        fieldObject4 = new FieldObject("4", "4", true, false, false);
            FieldObject        fieldObject5 = new FieldObject("5", "5", true, false, false);
            List <FieldObject> fieldObjects = new List <FieldObject>
            {
                fieldObject1,
                fieldObject2,
                fieldObject3,
                fieldObject4,
                fieldObject5
            };
            RowObject         rowObject   = new RowObject("1||1", fieldObjects);
            FormObject        formObject  = new FormObject("1", rowObject);
            List <FormObject> formObjects = new List <FormObject>
            {
                formObject
            };
            OptionObject2015 optionObject2015 = new OptionObject2015()
            {
                Forms = formObjects
            };

            List <string> excludedFields = new List <string>
            {
                "2",
                "4"
            };
            OptionObject2015 returnOptionObject = (OptionObject2015)OptionObjectHelpers.DisableAllFieldObjects(optionObject2015, excludedFields);

            Assert.IsFalse(returnOptionObject.IsFieldEnabled("1"));
            Assert.AreEqual("1", returnOptionObject.GetFieldValue("1"));
            Assert.IsTrue(returnOptionObject.IsFieldEnabled("2"));
            Assert.IsFalse(returnOptionObject.IsFieldEnabled("3"));
            Assert.IsTrue(returnOptionObject.IsFieldEnabled("4"));
            Assert.IsFalse(returnOptionObject.IsFieldEnabled("5"));
        }
Ejemplo n.º 4
0
        public void DisableAllFieldObjects_OptionObject2_FormCount_AreEqual()
        {
            OptionObject2 returnOptionObject = (OptionObject2)OptionObjectHelpers.DisableAllFieldObjects(optionObject2);

            Assert.AreEqual(optionObject2.Forms.Count, returnOptionObject.Forms.Count);
        }
Ejemplo n.º 5
0
        public void DisableAllFieldObjects_OptionObject2_ServerName_AreEqual()
        {
            OptionObject2 returnOptionObject = (OptionObject2)OptionObjectHelpers.DisableAllFieldObjects(optionObject2);

            Assert.AreEqual(optionObject2.ServerName, returnOptionObject.ServerName);
        }
Ejemplo n.º 6
0
        public void DisableAllFieldObjects_OptionObject2_SystemCode_AreEqual()
        {
            OptionObject2 returnOptionObject = (OptionObject2)OptionObjectHelpers.DisableAllFieldObjects(optionObject2);

            Assert.AreEqual(optionObject2.SystemCode, returnOptionObject.SystemCode);
        }
Ejemplo n.º 7
0
        public void DisableAllFieldObjects_OptionObject2_OptionUserID_AreEqual()
        {
            OptionObject2 returnOptionObject = (OptionObject2)OptionObjectHelpers.DisableAllFieldObjects(optionObject2);

            Assert.AreEqual(optionObject2.OptionUserId, returnOptionObject.OptionUserId);
        }
Ejemplo n.º 8
0
        public void DisableAllFieldObjects_OptionObject2_ParentNamespace_AreEqual()
        {
            OptionObject2 returnOptionObject = (OptionObject2)OptionObjectHelpers.DisableAllFieldObjects(optionObject2);

            Assert.AreEqual(optionObject2.ParentNamespace, returnOptionObject.ParentNamespace);
        }
Ejemplo n.º 9
0
        public void DisableAllFieldObjects_OptionObject2_Facility_AreEqual()
        {
            OptionObject2 returnOptionObject = (OptionObject2)OptionObjectHelpers.DisableAllFieldObjects(optionObject2);

            Assert.AreEqual(optionObject2.Facility, returnOptionObject.Facility);
        }
Ejemplo n.º 10
0
        public void DisableAllFieldObjects_OptionObject_OptionStaffID_AreEqual()
        {
            OptionObject returnOptionObject = (OptionObject)OptionObjectHelpers.DisableAllFieldObjects(optionObject);

            Assert.AreEqual(optionObject.OptionStaffId, returnOptionObject.OptionStaffId);
        }
Ejemplo n.º 11
0
        public void DisableAllFieldObjects_OptionObject2_EpisodeNumber_AreEqual()
        {
            OptionObject2 returnOptionObject = (OptionObject2)OptionObjectHelpers.DisableAllFieldObjects(optionObject2);

            Assert.AreEqual(optionObject2.EpisodeNumber, returnOptionObject.EpisodeNumber);
        }
Ejemplo n.º 12
0
        public void DisableAllFieldObjects_OptionObject2_EntityID_AreEqual()
        {
            OptionObject2 returnOptionObject = (OptionObject2)OptionObjectHelpers.DisableAllFieldObjects(optionObject2);

            Assert.AreEqual(optionObject2.EntityID, returnOptionObject.EntityID);
        }
 /// <summary>
 /// Sets all <see cref="FieldObject"/> as disabled except for any listed to be excluded.
 /// </summary>
 /// <param name="excludedFieldObjects"></param>
 public void DisableAllFieldObjects(List <string> excludedFieldObjects) => _optionObject.Forms = OptionObjectHelpers.DisableAllFieldObjects(_optionObject, excludedFieldObjects).Forms;
 /// <summary>
 /// Sets all <see cref="FieldObject"/> as disabled.
 /// </summary>
 public void DisableAllFieldObjects() => _optionObject.Forms = OptionObjectHelpers.DisableAllFieldObjects(_optionObject).Forms;
Ejemplo n.º 15
0
 /// <summary>
 /// Sets all <see cref="FieldObject"/> as disabled.
 /// </summary>
 public void DisableAllFieldObjects() => this.Forms = OptionObjectHelpers.DisableAllFieldObjects(this).Forms;