Esempio n. 1
0
        public void OnInit_NoUI()
        {
            MockAspNetService mockAspNet = new MockAspNetService();

            mockAspNet.SetIsPostBack(false);

            TestDriverPage page = new TestDriverPage(mockAspNet);

            page.TestCasesTreeView     = new System.Web.UI.WebControls.TreeView();
            page.AutoGenerateInterface = false;
            page.OnInitInternal();

            UnitTestAssert.IsNull(page.ThreadIdLabel);
        }
Esempio n. 2
0
        public void OnInit_NoLocators()
        {
            ServiceLocator.ApplicationPathFinder         = null;
            ServiceLocator.BrowserCommandExecutorFactory = null;
            MockAspNetService mockAspNet = new MockAspNetService();

            mockAspNet.SetIsPostBack(true);

            TestDriverPage page = new TestDriverPage(mockAspNet);

            page.TestCasesTreeView     = new System.Web.UI.WebControls.TreeView();
            page.AutoGenerateInterface = false;
            page.OnInitInternal();

            UnitTestAssert.IsNull(ServiceLocator.ApplicationPathFinder);
            UnitTestAssert.IsNull(ServiceLocator.BrowserCommandExecutorFactory);
        }
Esempio n. 3
0
        public void OnLoadComplete_HidesConsoleIfCheckboxIsNotSet()
        {
            MockAspNetService mockAspNet = new MockAspNetService();

            mockAspNet.SetIsPostBack(true);

            TestDriverPage page = new TestDriverPage(mockAspNet);

            page.ShowConsoleCheckBox         = new CheckBox();
            page.ShowConsoleCheckBox.Checked = false;

            page.TestsPanel  = new Panel();
            page.FooterPanel = new Panel();

            page.OnLoadCompleteInternal();
            UnitTestAssert.AreEqual("testsNoConsole", page.TestsPanel.CssClass);
            UnitTestAssert.IsFalse(page.FooterPanel.Visible);
        }
Esempio n. 4
0
        public void TestcasesTreeView_LoadSelectsNodesIfTargetIsTreeview()
        {
            MockAspNetService   mockAspNet = new MockAspNetService();
            NameValueCollection form       = new NameValueCollection();

            form.Add("__EVENTTARGET", null);
            mockAspNet.SetRequestForm(form);
            mockAspNet.SetIsPostBack(true);

            TestDriverPage page = new TestDriverPage(mockAspNet);

            page.TestCasesTreeView = new TreeView();
            TreeNode rootNode = new TreeNode("Foobar");

            rootNode.Checked = true;
            page.TestCasesTreeView.Nodes.Add(rootNode);
            page.TestcasesTreeview_LoadInternal();

            UnitTestAssert.IsTrue(rootNode.Checked);
        }
Esempio n. 5
0
        public void OnLoadComplete_ShowConsoleFromQueryString()
        {
            MockAspNetService mockAspNet = new MockAspNetService();

            mockAspNet.SetIsPostBack(false);
            NameValueCollection col = new NameValueCollection();

            col.Add("console", "false");
            mockAspNet.SetQueryString(col);

            TestDriverPage page = new TestDriverPage(mockAspNet);

            page.WriteLogToDiskCheckBox = new CheckBox();
            page.ShowConsoleCheckBox    = new CheckBox();
            page.FooterPanel            = new Panel();
            page.TestsPanel             = new Panel();
            page.OnLoadCompleteInternal();

            UnitTestAssert.AreEqual("testsNoConsole", page.TestsPanel.CssClass);
            UnitTestAssert.IsFalse(page.FooterPanel.Visible);
        }