Esempio n. 1
0
        /// <summary>
        /// Sets the Rows List
        /// </summary>
        public override void SetRowLists()
        {
            base.SetRowLists();
            int rowIndex = 0;

            foreach (var webElement in WebElementRows)
            {
                GridRowType rowType  = GetGridRowType(rowIndex);
                var         lineItem = new EditTeacherAssignmentRow(gridCssSelector, webElement, rowIndex, rowType, ColumnList, ControlPrefix);
                RowList.Add(lineItem);
                rowIndex++;
            }
        }
Esempio n. 2
0
 /// <summary>
 /// gets a list of rows containing the text to find from the row list
 /// </summary>
 /// <param name="columnName">the column name</param>
 /// <param name="textToFind">the text to find</param>
 /// <returns>list of GridRow</returns>
 public new List <EditTeacherAssignmentRow> GetsRowsContainingTextToFindFromList(string columnName, string textToFind)
 {
     if (RowList.Count == 0)
     {
         Assert.Fail("No items were found in the search results column list.");
         return(null);
     }
     else
     {
         List <EditTeacherAssignmentRow> rowList = new List <EditTeacherAssignmentRow>();
         string text  = null;
         int    index = 0;
         foreach (var row in RowList)
         {
             EditTeacherAssignmentRow editTeacherAssignmentRow = (EditTeacherAssignmentRow)row;
             //get the text by column name
             if (columnName.Equals(EditTeacherAssignmentColumnNames.Section))
             {
                 text = editTeacherAssignmentRow.GetSection();
                 //Debug.WriteLine("martin actual text: " + text);
                 //Debug.WriteLine("martin expected text to find: " + textToFind);
             }
             //if the text is not null
             if (text != null)
             {
                 //if the text contains the text to find
                 if (text.Contains(textToFind))
                 {
                     rowList.Add(editTeacherAssignmentRow);
                 }
             }
         }
         //may return empty row list if text is not found
         return(rowList);
     }
 }