示例#1
0
        public void TestcasesTreeView_LoadAddsRootNode()
        {
            MockAspNetService mockAspNet = new MockAspNetService();
            TestDriverPage    page       = new TestDriverPage(mockAspNet);

            page.TestCasesTreeView = new TreeView();
            page.TestcasesTreeview_LoadInternal();
            UnitTestAssert.AreEqual(1, page.TestCasesTreeView.Nodes.Count);
            UnitTestAssert.AreEqual("All Test Cases", page.TestCasesTreeView.Nodes[0].Text);
        }
示例#2
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);
        }