Exemplo n.º 1
0
        public void GetNextRowId_FormObjectNull()
        {
            FormObject formObject = null;
            string     rowId      = formObject.GetNextAvailableRowId();

            Assert.AreEqual("1||1", rowId);
        }
Exemplo n.º 2
0
        public void GetNextRowId_FormObjectNoCurrentRow()
        {
            FormObject formObject = new FormObject()
            {
                FormId            = "1",
                MultipleIteration = true
            };
            string rowId = formObject.GetNextAvailableRowId();

            Assert.AreEqual("1||1", rowId);
        }
Exemplo n.º 3
0
        public void GetNextRowId_FormObjectNonMI()
        {
            FormObject formObject = new FormObject()
            {
                FormId            = "1",
                MultipleIteration = false
            };

            formObject.AddRowObject(new RowObject());
            string rowId = formObject.GetNextAvailableRowId();

            Assert.AreNotEqual("1||2", rowId);
        }
Exemplo n.º 4
0
        public void GetNextRowId_FormObjectHasOtherRow()
        {
            FormObject formObject = new FormObject()
            {
                FormId            = "1",
                MultipleIteration = true
            };

            formObject.AddRowObject(new RowObject());
            formObject.AddRowObject(new RowObject());
            string rowId = formObject.GetNextAvailableRowId();

            Assert.AreEqual("1||3", rowId);
        }
Exemplo n.º 5
0
        public void GetNextRowId_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 = formObject.GetNextAvailableRowId();   // Should throw error as there are no more rows available

            Assert.AreNotEqual("1||10000", rowId);
        }