public void SetRowListsTest() { this.SchoolNet().LoadWebPage(); try { string gridCssSelector = "ProfileControl_InProgressTestResults_ctl00_gridResults"; ProfileHomeInProgressTestsGrid ProfileHomeInProgressTestsGrid = new ProfileHomeInProgressTestsGrid(gridCssSelector, false); int expectedNumber = 0; int actualNumber = 0; string expected = null; string actual = null; ProfileHomeInProgressTestsGrid.SetColumnLists(); ProfileHomeInProgressTestsGrid.SetRowLists(); expectedNumber = 6; actualNumber = ProfileHomeInProgressTestsGrid.GetRowList().Count(); Assert.AreEqual(expectedNumber, actualNumber, "Assess Dashboard In-Progress Tests Grid does not have the correct number of Rows."); expected = "Automated Test 1"; actual = ((ProfileHomeInProgressTestsRow)ProfileHomeInProgressTestsGrid.GetRowFromList(1)).GetTestName(); Assert.AreEqual(expected, actual, "First Column Data in the First Data Row of the Assess Dashboard In-Progress Tests Grid is incorrect"); expected = "Automated Test 2"; actual = ((ProfileHomeInProgressTestsRow)ProfileHomeInProgressTestsGrid.GetRowFromList(2)).GetTestName(); Assert.AreEqual(expected, actual, "First Column Data in the Second Data Row of the Assess Dashboard In-Progress Tests Grid is incorrect"); expected = "Automated Test 3"; actual = ((ProfileHomeInProgressTestsRow)ProfileHomeInProgressTestsGrid.GetRowFromList(3)).GetTestName(); Assert.AreEqual(expected, actual, "First Column Data in the Third Data Row of the Assess Dashboard In-Progress Tests Grid is incorrect"); expected = "Automated Test 4"; actual = ((ProfileHomeInProgressTestsRow)ProfileHomeInProgressTestsGrid.GetRowFromList(4)).GetTestName(); Assert.AreEqual(expected, actual, "First Column Data in the Fourth Data Row of the Assess Dashboard In-Progress Tests Grid is incorrect"); expected = "Automated Test 5"; actual = ((ProfileHomeInProgressTestsRow)ProfileHomeInProgressTestsGrid.GetRowFromList(5)).GetTestName(); Assert.AreEqual(expected, actual, "First Column Data in the Fifth Data Row of the Assess Dashboard In-Progress Tests Grid is incorrect"); } catch (Exception e) { TestContext.WriteLine("" + e.GetBaseException()); throw new Exception("\nMessage:\n" + e.Message + "\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace + "\n", e); } }
public void GetGridRowTypeTest() { this.SchoolNet().LoadWebPage(); try { string gridCssSelector = "ProfileControl_InProgressTestResults_ctl00_gridResults"; ProfileHomeInProgressTestsGrid ProfileHomeInProgressTestsGrid = new ProfileHomeInProgressTestsGrid(gridCssSelector, true); GridRowType expected; GridRowType actual; List <SNGridRow> ProfileHomeInProgressTestsGridRowList = ProfileHomeInProgressTestsGrid.GetRowList(); foreach (SNGridRow ProfileHomeInProgressTestsGridRow in ProfileHomeInProgressTestsGridRowList) { if (ProfileHomeInProgressTestsGridRow.Index == 0) { expected = GridRowType.Header; actual = ProfileHomeInProgressTestsGrid.GetGridRowType(ProfileHomeInProgressTestsGridRow.Index); Assert.AreEqual(expected, actual, "First Row of the Assess Dashboard In-Progress Tests Grid is not a Header Row"); } else { expected = GridRowType.Data; actual = ProfileHomeInProgressTestsGrid.GetGridRowType(ProfileHomeInProgressTestsGridRow.Index); Assert.AreEqual(expected, actual, string.Format("Row with Index '{0}' of the Assess Dashboard In-Progress Tests Grid is not a Data Row", ProfileHomeInProgressTestsGridRow.Index.ToString())); } } } catch (Exception e) { TestContext.WriteLine("" + e.GetBaseException()); throw new Exception("\nMessage:\n" + e.Message + "\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace + "\n", e); } }
public void ProfileHomeInProgressTestsGridTest() { this.SchoolNet().LoadWebPage(); try { string gridCssSelector = "ProfileControl_InProgressTestResults_ctl00_gridResults"; ProfileHomeInProgressTestsGrid ProfileHomeInProgressTestsGrid = new ProfileHomeInProgressTestsGrid(gridCssSelector, true); int expectedNumber = 0; int actualNumber = 0; string expected = null; string actual = null; expectedNumber = 4; actualNumber = ProfileHomeInProgressTestsGrid.GetColumnList().Count(); Assert.AreEqual(expectedNumber, actualNumber, "Assess Dashboard In-Progress Tests Grid does not have the correct number of columns."); expectedNumber = 6; actualNumber = ProfileHomeInProgressTestsGrid.GetRowList().Count(); Assert.AreEqual(expectedNumber, actualNumber, "Assess Dashboard In-Progress Tests Grid does not have the correct number of Rows."); expected = "Test Name"; actual = ProfileHomeInProgressTestsGrid.GetColumnFromList(0).Name; Assert.AreEqual(expected, actual, "First Column Name in the Assess Dashboard In-Progress Tests Grid is not as expected."); expected = "End Date"; actual = ProfileHomeInProgressTestsGrid.GetColumnFromList(1).Name; Assert.AreEqual(expected, actual, "Second Column Name in the Assess Dashboard In-Progress Tests Grid is not as expected."); expected = "Scores Due Date"; actual = ProfileHomeInProgressTestsGrid.GetColumnFromList(2).Name; Assert.AreEqual(expected, actual, "Third Column Name in the Assess Dashboard In-Progress Tests Grid is not as expected."); expected = "Collection Status"; actual = ProfileHomeInProgressTestsGrid.GetColumnFromList(3).Name; Assert.AreEqual(expected, actual, "Fourth Column Name in the Assess Dashboard In-Progress Tests Grid is not as expected."); expected = "Automated Test 1"; actual = ProfileHomeInProgressTestsGrid.GetsFirstRowContainingTextToFindFromList(ProfileHomeInProgressTestsGrid.GetColumnFromList(0).Name, expected).GetTestName(); Assert.AreEqual(expected, actual, "First Column Data in the First Data Row of the Assess Dashboard In-Progress Tests Grid is incorrect"); expected = "Automated Test 2"; actual = ProfileHomeInProgressTestsGrid.GetsFirstRowContainingTextToFindFromList(ProfileHomeInProgressTestsGrid.GetColumnFromList(0).Name, expected).GetTestName(); Assert.AreEqual(expected, actual, "First Column Data in the Second Data Row of the Assess Dashboard In-Progress Tests Grid is incorrect"); expected = "Automated Test 3"; actual = ProfileHomeInProgressTestsGrid.GetsFirstRowContainingTextToFindFromList(ProfileHomeInProgressTestsGrid.GetColumnFromList(0).Name, expected).GetTestName(); Assert.AreEqual(expected, actual, "First Column Data in the Third Data Row of the Assess Dashboard In-Progress Tests Grid is incorrect"); expected = "Automated Test 4"; actual = ProfileHomeInProgressTestsGrid.GetsFirstRowContainingTextToFindFromList(ProfileHomeInProgressTestsGrid.GetColumnFromList(0).Name, expected).GetTestName(); Assert.AreEqual(expected, actual, "First Column Data in the Fourth Data Row of the Assess Dashboard In-Progress Tests Grid is incorrect"); expected = "Automated Test 5"; actual = ProfileHomeInProgressTestsGrid.GetsFirstRowContainingTextToFindFromList(ProfileHomeInProgressTestsGrid.GetColumnFromList(0).Name, expected).GetTestName(); Assert.AreEqual(expected, actual, "First Column Data in the Fifth Data Row of the Assess Dashboard In-Progress Tests Grid is incorrect"); } catch (Exception e) { TestContext.WriteLine("" + e.GetBaseException()); throw new Exception("\nMessage:\n" + e.Message + "\nInnerException:\n" + e.InnerException + "\nStackTrace:\n" + e.StackTrace + "\n", e); } }