예제 #1
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));
        }
        public void IsRowMarkedForDeletion_OptionObject_Null()
        {
            string       rowId        = "1||1";
            OptionObject optionObject = null;

            Assert.IsTrue(optionObject.IsRowMarkedForDeletion(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));
        }
        public void IsRowMarkedForDeletion_OptionObject_FirstForm_IsNotMarked()
        {
            string     rowId      = "1||1";
            FormObject formObject = new FormObject("1");

            formObject.AddRowObject(new RowObject(rowId));
            OptionObject optionObject = new OptionObject();

            optionObject.AddFormObject(formObject);
            Assert.IsFalse(optionObject.IsRowMarkedForDeletion(rowId));
        }
        public void IsRowMarkedForDeletion_OptionObject_IsNotPresent()
        {
            string     rowId      = "1||1";
            RowObject  rowObject  = new RowObject(rowId);
            FormObject formObject = new FormObject("1");

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

            optionObject.AddFormObject(formObject);
            Assert.IsFalse(optionObject.IsRowMarkedForDeletion("2||1"));
        }
        public void IsRowMarkedForDeletion_OptionObject_SecondForm_IsNotMarked()
        {
            string     rowId       = "2||1";
            FormObject formObject1 = new FormObject("1");

            formObject1.AddRowObject(new RowObject());
            FormObject formObject2 = new FormObject("2");

            formObject2.AddRowObject(new RowObject(rowId));
            OptionObject optionObject = new OptionObject();

            optionObject.AddFormObject(formObject1);
            optionObject.AddFormObject(formObject2);
            Assert.IsFalse(optionObject.IsRowMarkedForDeletion(rowId));
        }