Example #1
0
        /// <summary>
        /// Creates a new table, and adds it to the GHTActivesubTest.
        /// </summary>
        /// <param name="ctrlType">The type of the ctrl to test. must be one of </param>
        /// <param name="description"></param>
        /// <returns></returns>
        protected Control GetHtmlTableRelated(Type ctrlType, bool a_AddToPage)
        {
            HtmlTable     l_table = new HtmlTable();
            HtmlTableRow  l_row   = new HtmlTableRow();
            HtmlTableCell l_cell  = new HtmlTableCell();

            if (a_AddToPage)
            {
                GHTActiveSubTest.Controls.Add(l_table);
            }
            l_table.Rows.Add(l_row);
            l_row.Cells.Add(l_cell);

            l_cell.InnerText = "Cell";

            if (l_table.GetType() == ctrlType)
            {
                return(l_table);
            }
            else if (l_row.GetType() == ctrlType)
            {
                return(l_row);
            }
            else if (l_cell.GetType() == ctrlType)
            {
                return(l_cell);
            }
            else
            {
                throw new ArgumentException("Should be HtmlTable related type.", "ctrlType = " + ctrlType.ToString());
            }
        }