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 DeleteRowObject_FromFormObject_Null() { FormObject formObject = null; formObject.DeleteRowObject("1||1"); Assert.IsFalse(formObject.IsFieldPresent("1||1")); }
public void Clone_FormObject_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 cloneFormObject = (FormObject)ScriptLinkHelpers.Clone(formObject); formObject.DeleteRowObject(rowObject); Assert.AreNotEqual(formObject, cloneFormObject); Assert.IsTrue(formObject.IsFieldPresent("123")); Assert.IsTrue(cloneFormObject.IsFieldPresent("123")); }
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)); }