public TableRow[] CreateExpectations(string testCase)
        {
            testCase = testCase ?? AllTests;
            _testControlGenerator = new TestControlGenerator(_testPage, new PostBackEventHandler());

            List <TableRow> rows = new List <TableRow>();

            rows.Add(Expect("open", UrlUtility.AddParameter(_testPage.ResolveClientUrl(_sutPage), SutGenerator.ServerDelayParameter, "500"), null));

            foreach (Control control in _testControlGenerator.GetTestControls(null))
            {
                rows.AddRange(ExpectControlAttributes(control));
            }

            foreach (Control initialControl in _testControlGenerator.GetTestControls(null))
            {
                if (testCase == AllTests || testCase == initialControl.ID)
                {
                    foreach (Control followUpControl in _testControlGenerator.GetTestControls(initialControl.ID))
                    {
                        rows.AddRange(ExpectPostbackForControl(initialControl, followUpControl));
                    }
                }
            }

            return(rows.ToArray());
        }
Beispiel #2
0
        public Control[] CreateSut()
        {
            Assertion.IsFalse(WcagHelper.Instance.IsWaiConformanceLevelARequired());

            List <Control> controls = new List <Control>();

            _label      = new Label();
            _label.Text = "Test Result: ###";
            controls.Add(_label);

            _postBackEventHandler           = new PostBackEventHandler();
            _postBackEventHandler.ID        = "PostBackEventHandler";
            _postBackEventHandler.PostBack += HandlePostBack;
            controls.Add(_postBackEventHandler);

            Table sutTable = new Table();

            sutTable.ID = "SutTable";
            sutTable.EnableViewState     = false;
            _testControlGenerator        = new TestControlGenerator(_sutPage, _postBackEventHandler);
            _testControlGenerator.Click += TestControlGeneratorOnClick;
            foreach (Control initialControl in _testControlGenerator.GetTestControls(null))
            {
                sutTable.Rows.Add(CreateRow(initialControl));
            }
            controls.Add(sutTable);

            return(controls.ToArray());
        }
        public TableRow[] CreateTestCases(string prefix)
        {
            TestControlGenerator testControlGenerator = new TestControlGenerator(_testSuitePage, new PostBackEventHandler());
            List <TableRow>      rows = new List <TableRow>();

            foreach (Control initialControl in testControlGenerator.GetTestControls(null))
            {
                if (testControlGenerator.IsEnabled(initialControl))
                {
                    rows.Add(
                        CreateTest(
                            CreateID(prefix, initialControl.ID),
                            UrlUtility.AddParameter(_testSuitePage.ResolveUrl(_testPage), TestExpectationsGenerator.TestCaseParameter, initialControl.ID)));
                }
            }

            return(rows.ToArray());
        }