Ejemplo n.º 1
0
        public void SetRowListsTest()
        {
            this.SchoolNet().LoadWebPage();

            try
            {
                string gridCssSelector = "ProfileControl_MyTestResults_ctl00_gridResults";
                ProfileHomeMyTestsGrid assessDashboardMyTestsGrid = new ProfileHomeMyTestsGrid(gridCssSelector, false);

                int    expectedNumber = 0;
                int    actualNumber   = 0;
                string expected       = null;
                string actual         = null;

                assessDashboardMyTestsGrid.SetColumnLists();
                assessDashboardMyTestsGrid.SetRowLists();

                expectedNumber = 6;
                actualNumber   = assessDashboardMyTestsGrid.GetRowList().Count();
                Assert.AreEqual(expectedNumber, actualNumber, "Assess Dashboard My Tests Grid does not have the correct number of Rows.");

                expected = "Automated Test 1";
                actual   = ((ProfileHomeMyTestsRow)assessDashboardMyTestsGrid.GetRowFromList(1)).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the First Data Row of the Assess Dashboard My Tests Grid is incorrect");

                expected = "Automated Test 2";
                actual   = ((ProfileHomeMyTestsRow)assessDashboardMyTestsGrid.GetRowFromList(2)).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the Second Data Row of the Assess Dashboard My Tests Grid is incorrect");

                expected = "Automated Test 3";
                actual   = ((ProfileHomeMyTestsRow)assessDashboardMyTestsGrid.GetRowFromList(3)).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the Third Data Row of the Assess Dashboard My Tests Grid is incorrect");

                expected = "Automated Test 4";
                actual   = ((ProfileHomeMyTestsRow)assessDashboardMyTestsGrid.GetRowFromList(4)).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the Fourth Data Row of the Assess Dashboard My Tests Grid is incorrect");

                expected = "Automated Test 5";
                actual   = ((ProfileHomeMyTestsRow)assessDashboardMyTestsGrid.GetRowFromList(5)).GetTestName();
                Assert.AreEqual(expected, actual, "First Column Data in the Fifth Data Row of the Assess Dashboard My Tests Grid is incorrect");
            }

            catch (Exception e)
            {
                throw new Exception("" + e.GetBaseException());
            }
        }
Ejemplo n.º 2
0
        public void SetColumnListsTest()
        {
            this.SchoolNet().LoadWebPage();

            try
            {
                string gridCssSelector = "ProfileControl_MyTestResults_ctl00_gridResults";
                ProfileHomeMyTestsGrid assessDashboardMyTestsGrid = new ProfileHomeMyTestsGrid(gridCssSelector, false);

                int    expectedNumber = 0;
                int    actualNumber   = 0;
                string expected       = null;
                string actual         = null;

                assessDashboardMyTestsGrid.SetColumnLists();

                expectedNumber = 4;
                actualNumber   = assessDashboardMyTestsGrid.GetColumnList().Count();
                Assert.AreEqual(expectedNumber, actualNumber, "Assess Dashboard My Tests Grid does not have the correct number of columns.");

                expected = "Test Name";
                actual   = assessDashboardMyTestsGrid.GetColumnFromList(0).Name;
                Assert.AreEqual(expected, actual, "First Column Name in the Assess Dashboard My Tests Grid is not as expected.");

                expected = "# of Items";
                actual   = assessDashboardMyTestsGrid.GetColumnFromList(1).Name;
                Assert.AreEqual(expected, actual, "Second Column Name in the Assess Dashboard My Tests Grid is not as expected.");

                expected = "Test Stage";
                actual   = assessDashboardMyTestsGrid.GetColumnFromList(2).Name;
                Assert.AreEqual(expected, actual, "Third Column Name in the Assess Dashboard My Tests Grid is not as expected.");

                expected = "Modified Date";
                actual   = assessDashboardMyTestsGrid.GetColumnFromList(3).Name;
                Assert.AreEqual(expected, actual, "Fourth Column Name in the Assess Dashboard My Tests Grid is not as expected.");
            }

            catch (Exception e)
            {
                throw new Exception("" + e.GetBaseException());
            }
        }