public void FormObject_SetFieldValue_NoMI_AreEqual()
        {
            FieldObject fieldObject = new FieldObject
            {
                Enabled     = "1",
                FieldNumber = "123",
                FieldValue  = "TEST",
                Lock        = "0",
                Required    = "0"
            };
            RowObject rowObject = new RowObject
            {
                RowId = "1||1"
            };

            rowObject.Fields.Add(fieldObject);
            FormObject formObject = new FormObject
            {
                CurrentRow        = rowObject,
                MultipleIteration = false
            };

            formObject.SetFieldValue("123", "MODIFIED");
            Assert.AreEqual("MODIFIED", formObject.GetFieldValue("123"));
            formObject.SetFieldValue("1||1", "123", "MODIFIED AGAIN");
            Assert.AreEqual("MODIFIED AGAIN", formObject.GetFieldValue("123"));
        }
Пример #2
0
        public void IsFieldModified_FormObject_IsTrue()
        {
            // Arrange
            FieldObject fieldObject01 = new FieldObject("123", "");
            FieldObject fieldObject02 = new FieldObject("124", "");
            FieldObject fieldObject03 = new FieldObject("125", "");
            RowObject   rowObject01   = new RowObject("1||1", new List <FieldObject>()
            {
                fieldObject01, fieldObject02, fieldObject03
            });
            FormObject formObject = new FormObject("1", rowObject01);

            // Act
            formObject.SetFieldValue("123", "MODIFIED");

            // Assert
            Assert.IsTrue(formObject.IsFieldModified("123"));
        }
        public void FormObject_SetFieldValue_MI_AreEqual()
        {
            FieldObject fieldObject1 = new FieldObject
            {
                Enabled     = "0",
                FieldNumber = "123",
                FieldValue  = "TEST",
                Lock        = "0",
                Required    = "0"
            };
            RowObject rowObject1 = new RowObject
            {
                RowId = "1||1"
            };

            rowObject1.Fields.Add(fieldObject1);
            FieldObject fieldObject2 = new FieldObject
            {
                Enabled     = "0",
                FieldNumber = "123",
                FieldValue  = "TEST2",
                Lock        = "0",
                Required    = "0"
            };
            RowObject rowObject2 = new RowObject
            {
                RowId = "1||2"
            };

            rowObject2.Fields.Add(fieldObject2);
            FormObject formObject = new FormObject
            {
                CurrentRow        = rowObject1,
                MultipleIteration = true
            };

            formObject.OtherRows.Add(rowObject2);

            formObject.SetFieldValue("1||2", "123", "MODIFIED");
            Assert.AreNotEqual("MODIFIED", formObject.GetFieldValue("123"));
            Assert.AreNotEqual("MODIFIED", formObject.GetFieldValue("1||1", "123"));
            Assert.AreEqual("MODIFIED", formObject.GetFieldValue("1||2", "123"));
        }