Пример #1
0
        public void DeleteRowObject_FromFormObject_MI_RowId_IsFound()
        {
            RowObject rowObject1 = new RowObject
            {
                RowId = "2||1"
            };
            RowObject rowObject2 = new RowObject
            {
                RowId = "2||1"
            };
            FormObject formObject = new FormObject
            {
                FormId            = "2",
                MultipleIteration = true
            };

            formObject.CurrentRow = rowObject1;
            formObject.OtherRows.Add(rowObject2);

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

            Assert.IsTrue(formObject.IsRowPresent(rowObject1.RowId));
            Assert.IsTrue(formObject.IsRowMarkedForDeletion(rowObject1.RowId));
            Assert.IsTrue(formObject.IsRowPresent(rowObject2.RowId));
            Assert.IsTrue(formObject.IsRowMarkedForDeletion(rowObject2.RowId));
        }
        public void IsRowMarkedForDeletion_FormObject_Null()
        {
            string     rowId      = "1||1";
            FormObject formObject = null;

            Assert.IsTrue(formObject.IsRowMarkedForDeletion(rowId));
        }
        public void IsRowMarkedForDeletion_FormObject_IsNotMarked()
        {
            string     rowId      = "1||1";
            FormObject formObject = new FormObject("1");

            formObject.AddRowObject(new RowObject(rowId));
            Assert.IsFalse(formObject.IsRowMarkedForDeletion(rowId));
        }
        public void IsRowMarkedForDeletion_FormObject_IsMarked()
        {
            string     rowId      = "1||1";
            FormObject formObject = new FormObject("1");

            formObject.AddRowObject(new RowObject(rowId, rowId, RowAction.Delete));
            Assert.IsTrue(formObject.IsRowMarkedForDeletion(rowId));
        }
        public void IsRowMarkedForDeletion_FormObject_IsNotPresent()
        {
            string     rowId      = "1||1";
            RowObject  rowObject  = new RowObject(rowId);
            FormObject formObject = new FormObject("1");

            formObject.AddRowObject(rowObject);
            Assert.IsFalse(formObject.IsRowMarkedForDeletion("2||1"));
        }
Пример #6
0
        public void DeleteRowObject_FromFormObject_RowId_IsFound()
        {
            RowObject rowObject = new RowObject
            {
                RowId = "1||1"
            };
            FormObject formObject = new FormObject
            {
                FormId            = "1",
                MultipleIteration = false
            };

            formObject.CurrentRow = rowObject;

            formObject.DeleteRowObject(rowObject.RowId);

            Assert.IsTrue(formObject.IsRowPresent(rowObject.RowId));
            Assert.IsTrue(formObject.IsRowMarkedForDeletion(rowObject.RowId));
        }
        public void FormObject_Clone_AreNotEqual()
        {
            List <FieldObject> fieldObjects = new List <FieldObject>
            {
                new FieldObject("123", "Test")
            };
            RowObject  rowObject  = new RowObject("1||1", fieldObjects);
            FormObject formObject = new FormObject("1", rowObject);

            FormObject cloneObject = formObject.Clone();

            formObject.DeleteRowObject(rowObject);

            Assert.AreNotEqual(formObject.ToJson(), cloneObject.ToJson());
            Assert.AreNotEqual(formObject, cloneObject);
            Assert.IsTrue(formObject.IsFieldPresent("123"));
            Assert.IsTrue(formObject.IsRowMarkedForDeletion("1||1"));
            Assert.IsTrue(cloneObject.IsFieldPresent("123"));
            Assert.IsFalse(cloneObject.IsRowMarkedForDeletion("1||1"));
        }
        public void DeleteRowObject_FormObject_MI_RowObject_IsNotFound()
        {
            RowObject rowObject = new RowObject
            {
                RowId = "2||1"
            };
            RowObject rowObject2 = new RowObject
            {
                RowId = "2||2"
            };
            FormObject formObject = new FormObject
            {
                FormId            = "2",
                MultipleIteration = true
            };

            formObject.CurrentRow = rowObject;

            formObject.DeleteRowObject(rowObject2);

            Assert.IsTrue(formObject.IsRowPresent(rowObject2.RowId));
            Assert.IsTrue(formObject.IsRowMarkedForDeletion(rowObject2.RowId));
        }