public void GetNextRowId_OptionObjectHelpers_FormObjectNull() { FormObject formObject = null; string rowId = OptionObjectHelpers.GetNextAvailableRowId(formObject); Assert.AreEqual("1||1", rowId); }
public void GetNextRowId_OptionObjectHelpers_FormObjectNoCurrentRow() { FormObject formObject = new FormObject() { FormId = "1", MultipleIteration = true }; string rowId = OptionObjectHelpers.GetNextAvailableRowId(formObject); Assert.AreEqual("1||1", rowId); }
public void GetNextRowId_OptionObjectHelpers_FormObjectNonMI() { FormObject formObject = new FormObject() { FormId = "1", MultipleIteration = false }; formObject.AddRowObject(new RowObject()); string rowId = OptionObjectHelpers.GetNextAvailableRowId(formObject); Assert.AreNotEqual("1||2", rowId); }
public void GetNextRowId_OptionObjectHelpers_FormObjectHasOtherRow() { FormObject formObject = new FormObject() { FormId = "1", MultipleIteration = true }; formObject.AddRowObject(new RowObject()); formObject.AddRowObject(new RowObject()); string rowId = OptionObjectHelpers.GetNextAvailableRowId(formObject); Assert.AreEqual("1||3", rowId); }
public void GetNextRowId_OptionObjectHelpers_FormObjectHasMaximumRows() { FormObject formObject = new FormObject() { FormId = "1", MultipleIteration = true }; formObject.AddRowObject(new RowObject()); int rowsToAdd = 9998; for (int i = 0; i < rowsToAdd; ++i) { string tempRowId = formObject.FormId + "||" + (i + 2).ToString(); formObject.OtherRows.Add(new RowObject(tempRowId)); } string rowId = OptionObjectHelpers.GetNextAvailableRowId(formObject); // Should throw error as there are no more rows available Assert.AreNotEqual("1||10000", rowId); }
/// <summary> /// Returns the next available RowId of the <see cref="FormObject"/>. /// </summary> /// <returns></returns> public string GetNextAvailableRowId() => OptionObjectHelpers.GetNextAvailableRowId(this);