Ejemplo n.º 1
0
        public void DeleteRowObject_FromOptionObject2_RowId_IsNotFound()
        {
            RowObject rowObject = new RowObject
            {
                RowId = "1||1"
            };
            RowObject rowObject2 = new RowObject
            {
                RowId = "2||1"
            };
            FormObject formObject = new FormObject
            {
                FormId            = "1",
                MultipleIteration = false
            };

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

            optionObject.Forms.Add(formObject);

            optionObject.DeleteRowObject(rowObject2.RowId);

            Assert.IsTrue(optionObject.IsRowPresent(rowObject2.RowId));
            Assert.IsTrue(optionObject.IsRowMarkedForDeletion(rowObject2.RowId));
        }
Ejemplo n.º 2
0
        public void DeleteRowObject_FromOptionObject2_Null()
        {
            OptionObject2 optionObject = null;

            optionObject.DeleteRowObject("1||1");
            Assert.IsFalse(optionObject.IsFieldPresent("1||1"));
        }
        public void DeleteRowObject_OptionObject2_MI_RowId_IsFound()
        {
            RowObject rowObject = new RowObject
            {
                RowId = "1||1"
            };
            FormObject formObject1 = new FormObject
            {
                FormId            = "1",
                MultipleIteration = false
            };

            formObject1.CurrentRow = rowObject;
            RowObject rowObject1 = new RowObject
            {
                RowId = "2||1"
            };
            RowObject rowObject2 = new RowObject
            {
                RowId = "2||2"
            };
            FormObject formObject2 = new FormObject
            {
                FormId            = "1",
                MultipleIteration = true
            };

            formObject2.CurrentRow = rowObject1;
            formObject2.OtherRows.Add(rowObject2);
            OptionObject2 optionObject = new OptionObject2();

            optionObject.Forms.Add(formObject1);
            optionObject.Forms.Add(formObject1);

            optionObject.DeleteRowObject(rowObject1.RowId);
            optionObject.DeleteRowObject(rowObject2.RowId);

            Assert.IsTrue(optionObject.IsRowPresent(rowObject1.RowId));
            Assert.IsTrue(optionObject.IsRowMarkedForDeletion(rowObject1.RowId));
            Assert.IsTrue(optionObject.IsRowPresent(rowObject2.RowId));
            Assert.IsTrue(optionObject.IsRowMarkedForDeletion(rowObject2.RowId));
        }