public void OptionObject2015_GetParentRowId_Error() { OptionObject2015 optionObject = new OptionObject2015(); var actual = optionObject.GetParentRowId("1"); Assert.AreEqual(null, actual); }
public void GetParentRowIdOptionObject2015ReturnsExpected() { RowObject rowObject1 = new RowObject() { RowId = "1||1", ParentRowId = "1||1" }; RowObject rowObject2 = new RowObject() { RowId = "1||2", ParentRowId = "1||1" }; FormObject formObject = new FormObject() { FormId = "1", MultipleIteration = true, CurrentRow = rowObject1 }; formObject.OtherRows.Add(rowObject2); OptionObject2015 optionObject = new OptionObject2015() { EntityID = "1", SystemCode = "UAT" }; optionObject.Forms.Add(formObject); string expected = "1||1"; Assert.AreEqual(expected, optionObject.GetParentRowId("1")); }
public void OptionObject2015_GetParentRowId_AreEqual() { RowObject rowObject = new RowObject { ParentRowId = "1||1" }; FormObject formObject = new FormObject { FormId = "1", CurrentRow = rowObject }; OptionObject2015 optionObject = new OptionObject2015(); optionObject.Forms.Add(formObject); var actual = optionObject.GetParentRowId("1"); Assert.AreEqual(rowObject.ParentRowId, actual); }