示例#1
0
        public void DeleteRowObject_FromOptionObject_Null()
        {
            OptionObject optionObject = null;

            optionObject.DeleteRowObject("1||1");
            Assert.IsFalse(optionObject.IsFieldPresent("1||1"));
        }
示例#2
0
        public void DeleteRowObject_FromOptionObject_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;
            OptionObject optionObject = new OptionObject();

            optionObject.Forms.Add(formObject);

            optionObject.DeleteRowObject(rowObject2.RowId);

            Assert.IsTrue(optionObject.IsRowPresent(rowObject2.RowId));
            Assert.IsTrue(optionObject.IsRowMarkedForDeletion(rowObject2.RowId));
        }
示例#3
0
        public void DeleteRowObject_FromOptionObject_MI_RowObject_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);
            OptionObject optionObject = new OptionObject();

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

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

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