public void OptionObject_GetParentRowId_Error()
        {
            OptionObject optionObject = new OptionObject();
            var          actual       = optionObject.GetParentRowId("1");

            Assert.AreEqual(null, actual);
        }
Esempio n. 2
0
        public void GetParentRowIdOptionObjectReturnsExpected()
        {
            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);
            OptionObject optionObject = new OptionObject()
            {
                EntityID   = "1",
                SystemCode = "UAT"
            };

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

            Assert.AreEqual(expected, optionObject.GetParentRowId("1"));
        }
        public void OptionObject_GetParentRowId_AreEqual()
        {
            RowObject rowObject = new RowObject
            {
                ParentRowId = "1||1"
            };
            FormObject formObject = new FormObject
            {
                FormId     = "1",
                CurrentRow = rowObject
            };
            OptionObject optionObject = new OptionObject();

            optionObject.Forms.Add(formObject);
            var actual = optionObject.GetParentRowId("1");

            Assert.AreEqual(rowObject.ParentRowId, actual);
        }