public void SetDisabledFields_OptionObject2015_Null_ListFieldNumbers()
        {
            string        fieldNumber  = "123";
            FieldObject   fieldObject  = new FieldObject(fieldNumber);
            List <string> fieldNumbers = new List <string>()
            {
                fieldNumber
            };
            RowObject rowObject = new RowObject();

            rowObject.AddFieldObject(fieldObject);
            FormObject formObject = new FormObject("1");

            formObject.AddRowObject(rowObject);
            OptionObject2015 optionObject = null;

            optionObject.SetDisabledFields(fieldNumbers);
            Assert.IsFalse(optionObject.IsFieldEnabled(fieldNumber));
        }
        public void SetDisabledFields_OptionObject_Null_Helper_ListFieldObjects()
        {
            string             fieldNumber  = "123";
            FieldObject        fieldObject  = new FieldObject(fieldNumber);
            List <FieldObject> fieldObjects = new List <FieldObject>()
            {
                fieldObject
            };
            RowObject rowObject = new RowObject();

            rowObject.AddFieldObject(fieldObject);
            FormObject formObject = new FormObject("1");

            formObject.AddRowObject(rowObject);
            OptionObject optionObject = null;

            ScriptLinkHelpers.SetDisabledFields(optionObject, fieldObjects);
            Assert.IsFalse(optionObject.IsFieldEnabled(fieldNumber));
        }
Exemplo n.º 3
0
        public void SetFieldObjects_OptionObject2_Disabled_FieldObjectsNull()
        {
            string             fieldNumber  = "123";
            List <FieldObject> fieldObjects = null;
            RowObject          rowObject    = new RowObject();

            rowObject.AddFieldObject(new FieldObject(fieldNumber));
            FormObject formObject = new FormObject("1");

            formObject.AddRowObject(rowObject);
            OptionObject2 optionObject = new OptionObject2();

            optionObject.AddFormObject(formObject);

            ScriptLinkHelpers.SetFieldObjects(optionObject, FieldAction.Disable, fieldObjects);

            Assert.IsFalse(optionObject.IsFieldEnabled(fieldNumber));
            Assert.IsFalse(optionObject.IsFieldRequired(fieldNumber));
        }
        public void SetFieldObjects_FormObject_BlankAction_FieldNumbers()
        {
            string        fieldNumber  = "123";
            List <string> fieldNumbers = new List <string>()
            {
                fieldNumber
            };
            RowObject rowObject = new RowObject();

            rowObject.AddFieldObject(new FieldObject(fieldNumber));
            FormObject formObject = new FormObject("1");

            formObject.AddRowObject(rowObject);

            OptionObjectHelpers.SetFieldObjects(formObject, "", fieldNumbers);

            Assert.IsFalse(formObject.IsFieldEnabled(fieldNumber));
            Assert.IsFalse(formObject.IsFieldRequired(fieldNumber));
        }
Exemplo n.º 5
0
        public void SetLockedFields_OptionObject2015_Null_Helper_ListFieldNumbers()
        {
            string        fieldNumber  = "123";
            FieldObject   fieldObject  = new FieldObject(fieldNumber);
            List <string> fieldNumbers = new List <string>()
            {
                fieldNumber
            };
            RowObject rowObject = new RowObject();

            rowObject.AddFieldObject(fieldObject);
            FormObject formObject = new FormObject("1");

            formObject.AddRowObject(rowObject);
            OptionObject2015 optionObject = null;

            ScriptLinkHelpers.SetLockedFields(optionObject, fieldNumbers);
            Assert.IsFalse(optionObject.IsFieldLocked(fieldNumber));
        }
        public void SetFieldObjects_FormObject_Disabled_FieldNumbersNotPresent()
        {
            string        fieldNumber  = "123";
            List <string> fieldNumbers = new List <string>()
            {
                "234"
            };
            RowObject rowObject = new RowObject();

            rowObject.AddFieldObject(new FieldObject(fieldNumber));
            FormObject formObject = new FormObject("1");

            formObject.AddRowObject(rowObject);

            OptionObjectHelpers.SetFieldObjects(formObject, FieldAction.Disable, fieldNumbers);

            Assert.IsFalse(formObject.IsFieldEnabled(fieldNumber));
            Assert.IsFalse(formObject.IsFieldRequired(fieldNumber));
        }
        public void FormObject_AddRowObject_NoMI_RowObject()
        {
            RowObject rowObject1 = new RowObject
            {
                RowId = "1||1"
            };
            RowObject rowObject2 = new RowObject
            {
                RowId = "1||2"
            };
            FormObject formObject = new FormObject
            {
                MultipleIteration = false
            };

            formObject.AddRowObject(rowObject1);
            Assert.AreEqual(rowObject1, formObject.CurrentRow);
            Assert.IsFalse(formObject.OtherRows.Contains(rowObject1));
        }
Exemplo n.º 8
0
        public void SetEnabledFields_OptionObject2_Null_Helper_ListFieldNumbers()
        {
            string        fieldNumber  = "123";
            FieldObject   fieldObject  = new FieldObject(fieldNumber);
            List <string> fieldNumbers = new List <string>()
            {
                fieldNumber
            };
            RowObject rowObject = new RowObject();

            rowObject.AddFieldObject(fieldObject);
            FormObject formObject = new FormObject("1");

            formObject.AddRowObject(rowObject);
            OptionObject2 optionObject = null;

            OptionObjectHelpers.SetEnabledFields(optionObject, fieldNumbers);
            Assert.IsFalse(optionObject.IsFieldEnabled(fieldNumber));
            Assert.IsFalse(optionObject.IsFieldRequired(fieldNumber));
        }
Exemplo n.º 9
0
        public void SetLockedFields_OptionObject_Helper_ListFieldObjects()
        {
            string             fieldNumber  = "123";
            FieldObject        fieldObject  = new FieldObject(fieldNumber);
            List <FieldObject> fieldObjects = new List <FieldObject>()
            {
                fieldObject
            };
            RowObject rowObject = new RowObject();

            rowObject.AddFieldObject(fieldObject);
            FormObject formObject = new FormObject("1");

            formObject.AddRowObject(rowObject);
            OptionObject optionObject = new OptionObject();

            optionObject.AddFormObject(formObject);
            ScriptLinkHelpers.SetLockedFields(optionObject, fieldObjects);
            Assert.IsTrue(optionObject.IsFieldLocked(fieldNumber));
        }
Exemplo n.º 10
0
        public void SetLockedFields_OptionObject2015_ListFieldNumbers()
        {
            string        fieldNumber  = "123";
            FieldObject   fieldObject  = new FieldObject(fieldNumber);
            List <string> fieldNumbers = new List <string>()
            {
                fieldNumber
            };
            RowObject rowObject = new RowObject();

            rowObject.AddFieldObject(fieldObject);
            FormObject formObject = new FormObject("1");

            formObject.AddRowObject(rowObject);
            OptionObject2015 optionObject = new OptionObject2015();

            optionObject.AddFormObject(formObject);
            optionObject.SetLockedFields(fieldNumbers);
            Assert.IsTrue(optionObject.IsFieldLocked(fieldNumber));
        }
Exemplo n.º 11
0
        public void SetUnlockedFields_OptionObject2_Helper_ListFieldNumbers()
        {
            string        fieldNumber  = "123";
            FieldObject   fieldObject  = new FieldObject(fieldNumber);
            List <string> fieldNumbers = new List <string>()
            {
                fieldNumber
            };
            RowObject rowObject = new RowObject();

            rowObject.AddFieldObject(fieldObject);
            FormObject formObject = new FormObject("1");

            formObject.AddRowObject(rowObject);
            OptionObject2 optionObject = new OptionObject2();

            optionObject.AddFormObject(formObject);
            OptionObjectHelpers.SetUnlockedFields(optionObject, fieldNumbers);
            Assert.IsFalse(optionObject.IsFieldLocked(fieldNumber));
        }
Exemplo n.º 12
0
        public void SetFieldObjects_OptionObject2015_Null_Disabled_FieldNumbers()
        {
            string        fieldNumber  = "123";
            List <string> fieldNumbers = new List <string>()
            {
                fieldNumber
            };
            RowObject rowObject = new RowObject();

            rowObject.AddFieldObject(new FieldObject(fieldNumber));
            FormObject formObject = new FormObject("1");

            formObject.AddRowObject(rowObject);
            OptionObject2015 optionObject = null;

            ScriptLinkHelpers.SetFieldObjects(optionObject, FieldAction.Disable, fieldNumbers);

            Assert.IsFalse(optionObject.IsFieldEnabled(fieldNumber));
            Assert.IsFalse(optionObject.IsFieldRequired(fieldNumber));
        }
Exemplo n.º 13
0
        public void SetEnabledFields_OptionObject2015_Helper_ListFieldObjects()
        {
            string             fieldNumber  = "123";
            FieldObject        fieldObject  = new FieldObject(fieldNumber);
            List <FieldObject> fieldObjects = new List <FieldObject>()
            {
                fieldObject
            };
            RowObject rowObject = new RowObject();

            rowObject.AddFieldObject(fieldObject);
            FormObject formObject = new FormObject("1");

            formObject.AddRowObject(rowObject);
            OptionObject2015 optionObject = new OptionObject2015();

            optionObject.AddFormObject(formObject);
            OptionObjectHelpers.SetEnabledFields(optionObject, fieldObjects);
            Assert.IsTrue(optionObject.IsFieldEnabled(fieldNumber));
            Assert.IsFalse(optionObject.IsFieldRequired(fieldNumber));
        }
        public void SetOptionalFields_OptionObject2_ListFieldNumbers()
        {
            string        fieldNumber  = "123";
            FieldObject   fieldObject  = new FieldObject(fieldNumber);
            List <string> fieldNumbers = new List <string>()
            {
                fieldNumber
            };
            RowObject rowObject = new RowObject();

            rowObject.AddFieldObject(fieldObject);
            FormObject formObject = new FormObject("1");

            formObject.AddRowObject(rowObject);
            OptionObject2 optionObject = new OptionObject2();

            optionObject.AddFormObject(formObject);
            optionObject.SetOptionalFields(fieldNumbers);
            Assert.IsTrue(optionObject.IsFieldEnabled(fieldNumber));
            Assert.IsFalse(optionObject.IsFieldRequired(fieldNumber));
        }
Exemplo n.º 15
0
        public void SetFieldObjects_OptionObject2015_BlankAction_FieldObjects()
        {
            string             fieldNumber  = "123";
            List <FieldObject> fieldObjects = new List <FieldObject>()
            {
                new FieldObject(fieldNumber)
            };
            RowObject rowObject = new RowObject();

            rowObject.AddFieldObject(new FieldObject(fieldNumber));
            FormObject formObject = new FormObject("1");

            formObject.AddRowObject(rowObject);
            OptionObject2015 optionObject = new OptionObject2015();

            optionObject.AddFormObject(formObject);

            ScriptLinkHelpers.SetFieldObjects(optionObject, "", fieldObjects);

            Assert.IsFalse(optionObject.IsFieldEnabled(fieldNumber));
            Assert.IsFalse(optionObject.IsFieldRequired(fieldNumber));
        }
        public void SetFieldObjects_OptionObject2015_Disabled_FieldObjectsNotPresent()
        {
            string             fieldNumber  = "123";
            List <FieldObject> fieldObjects = new List <FieldObject>()
            {
                new FieldObject("234")
            };
            RowObject rowObject = new RowObject();

            rowObject.AddFieldObject(new FieldObject(fieldNumber));
            FormObject formObject = new FormObject("1");

            formObject.AddRowObject(rowObject);
            OptionObject2015 optionObject = new OptionObject2015();

            optionObject.AddFormObject(formObject);

            OptionObjectHelpers.SetFieldObjects(optionObject, FieldAction.Disable, fieldObjects);

            Assert.IsFalse(optionObject.IsFieldEnabled(fieldNumber));
            Assert.IsFalse(optionObject.IsFieldRequired(fieldNumber));
        }
Exemplo n.º 17
0
        public void GetNextRowId_FormObjectHasMaximumRows()
        {
            FormObject formObject = new FormObject()
            {
                FormId            = "1",
                MultipleIteration = true
            };

            formObject.AddRowObject(new RowObject());

            int rowsToAdd = 9998;

            for (int i = 0; i < rowsToAdd; ++i)
            {
                string tempRowId = formObject.FormId + "||" + (i + 2).ToString();
                formObject.OtherRows.Add(new RowObject(tempRowId));
            }

            string rowId = formObject.GetNextAvailableRowId();   // Should throw error as there are no more rows available

            Assert.AreNotEqual("1||10000", rowId);
        }