private TableRow[] ExpectPostbackForControl(Control initialControl, Control followUpControl)
        {
            List <TableRow> rows = new List <TableRow>();

            if (_testControlGenerator.IsEnabled(initialControl) && _testControlGenerator.IsEnabled(followUpControl))
            {
                rows.Add(ExpectControlClick(initialControl));
                if (_testControlGenerator.IsAlertHyperLink(initialControl))
                {
                    rows.Add(Expect("waitForAlert", "*", null));
                }
                rows.Add(ExpectControlClick(followUpControl));
                if (_testControlGenerator.IsAlertHyperLink(followUpControl))
                {
                    rows.Add(Expect("waitForAlert", "*", null));
                }
                if (_testControlGenerator.IsAlertHyperLink(initialControl) || _testControlGenerator.IsAlertHyperLink(followUpControl))
                {
                    rows.Add(Expect("assertElementNotPresent", "SmartPageStatusIsSubmittingMessage", null));
                }
                if (!_testControlGenerator.IsAlertHyperLink(initialControl) && !_testControlGenerator.IsAlertHyperLink(followUpControl))
                {
                    rows.Add(Expect("waitForVisible", "SmartPageStatusIsSubmittingMessage", null));
                }
                if (!_testControlGenerator.IsAlertHyperLink(initialControl) || !_testControlGenerator.IsAlertHyperLink(followUpControl))
                {
                    rows.Add(Expect("waitForPageToLoad", "1000", null));
                }
                if (!_testControlGenerator.IsAlertHyperLink(initialControl) && _testControlGenerator.IsAlertHyperLink(followUpControl))
                {
                    rows.Add(Expect("assertValue", SutGenerator.LastClickFieldID, initialControl.ID));
                }
                if (_testControlGenerator.IsAlertHyperLink(initialControl) && !_testControlGenerator.IsAlertHyperLink(followUpControl))
                {
                    rows.Add(Expect("assertValue", SutGenerator.LastClickFieldID, followUpControl.ID));
                }
            }
            return(rows.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());
        }