Ejemplo n.º 1
0
        public void GetParentRowIdHelperNull2015ReturnsExpected()
        {
            OptionObject2015 optionObject = null;
            string           expected     = "1||1";

            Assert.AreEqual(expected, OptionObjectHelpers.GetParentRowId(optionObject, "1"));
        }
Ejemplo n.º 2
0
        public void GetParentRowIdHelperOptionObject2015ReturnsNotFound()
        {
            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 = "2||1";

            Assert.AreEqual(expected, OptionObjectHelpers.GetParentRowId(optionObject, "2"));
        }
Ejemplo n.º 3
0
        public void GetParentRowIdHelperOptionObject2015NoFormsReturnsError()
        {
            OptionObject2015 optionObject = new OptionObject2015()
            {
                EntityID   = "1",
                SystemCode = "UAT"
            };
            string expected = "1||1";

            Assert.AreEqual(expected, OptionObjectHelpers.GetParentRowId(optionObject, "1"));
        }
Ejemplo n.º 4
0
        public void GetParentRowIdHelperOptionObject2015NoCurrentRowReturnsError()
        {
            FormObject formObject = new FormObject()
            {
                FormId            = "1",
                MultipleIteration = true
            };
            OptionObject2015 optionObject = new OptionObject2015()
            {
                EntityID   = "1",
                SystemCode = "UAT"
            };

            optionObject.Forms.Add(formObject);
            string expected = "1||1";

            Assert.AreEqual(expected, OptionObjectHelpers.GetParentRowId(optionObject, "1"));
        }
 /// <summary>
 /// Returns the CurrentRow ParentRowId of the form matching the FormId.
 /// </summary>
 /// <param name="formId"></param>
 /// <returns></returns>
 public string GetParentRowId(string formId) => OptionObjectHelpers.GetParentRowId(_optionObject, formId);
 /// <summary>
 /// Returns the ParentRowId of the <see cref="CurrentRow"/>.
 /// </summary>
 /// <returns></returns>
 public string GetParentRowId() => OptionObjectHelpers.GetParentRowId(this);