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

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

                string expected = null;
                string actual   = null;

                expected = "Automated Test 1";
                actual   = assessDashboardMyTestsGrid.GetsFirstRowContainingTextToFindFromList(assessDashboardMyTestsGrid.GetColumnFromList(0).Name, expected).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   = assessDashboardMyTestsGrid.GetsFirstRowContainingTextToFindFromList(assessDashboardMyTestsGrid.GetColumnFromList(0).Name, expected).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   = assessDashboardMyTestsGrid.GetsFirstRowContainingTextToFindFromList(assessDashboardMyTestsGrid.GetColumnFromList(0).Name, expected).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   = assessDashboardMyTestsGrid.GetsFirstRowContainingTextToFindFromList(assessDashboardMyTestsGrid.GetColumnFromList(0).Name, expected).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   = assessDashboardMyTestsGrid.GetsFirstRowContainingTextToFindFromList(assessDashboardMyTestsGrid.GetColumnFromList(0).Name, expected).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 AssessDashboardMyTestsGridTest()
        {
            this.SchoolNet().LoadWebPage();

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

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

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

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

                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.");

                expected = "Automated Test 1";
                actual   = assessDashboardMyTestsGrid.GetsFirstRowContainingTextToFindFromList(assessDashboardMyTestsGrid.GetColumnFromList(0).Name, expected).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   = assessDashboardMyTestsGrid.GetsFirstRowContainingTextToFindFromList(assessDashboardMyTestsGrid.GetColumnFromList(0).Name, expected).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   = assessDashboardMyTestsGrid.GetsFirstRowContainingTextToFindFromList(assessDashboardMyTestsGrid.GetColumnFromList(0).Name, expected).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   = assessDashboardMyTestsGrid.GetsFirstRowContainingTextToFindFromList(assessDashboardMyTestsGrid.GetColumnFromList(0).Name, expected).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   = assessDashboardMyTestsGrid.GetsFirstRowContainingTextToFindFromList(assessDashboardMyTestsGrid.GetColumnFromList(0).Name, expected).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());
            }
        }