Пример #1
0
        public void TestFormsTreeNodeGetItemIndexs()
        {
            FormsTreeView treeView1 = new FormsTreeView(testDlg["treeView1"]());
            FormsTreeNode item      = treeView1.GetItem(0, 1);

            Assert.AreEqual(@"Child 2", item.Text);
        }
Пример #2
0
        /// <summary>
        /// FormsTreeNode GetItem(params string[] keys)のテスト
        /// </summary>
        public void TestFormsTreeNodeGetItemKeys()
        {
            FormsTreeView treeView1 = new FormsTreeView(testDlg["treeView1"]());
            FormsTreeNode item      = treeView1.GetItem(@"Parent", @"Child 2", @"GrandChild");

            Assert.AreEqual(@"GrandChild", item.Text);
        }
Пример #3
0
        public void TestChecked()
        {
            FormsTreeView treeView1 = new FormsTreeView(testDlg["treeView1"]());
            FormsTreeNode item      = treeView1.FindItem("Parent");

            item.EmulateCheck(true);
            Assert.AreEqual(true, item.Checked);
        }
Пример #4
0
        public void TestIsExpanded()
        {
            FormsTreeView treeView1 = new FormsTreeView(testDlg["treeView1"]());
            FormsTreeNode item      = treeView1.FindItem("Parent");

            item.EmulateExpand();
            Assert.AreEqual(true, item.IsExpanded);
        }
Пример #5
0
        public void TestFormsTreeNodeSelect()
        {
            FormsTreeView treeView1 = new FormsTreeView(testDlg["treeView1"]());

            treeView1.FindItem("Parent", "Child 1").EmulateSelect();
            FormsTreeNode selectedNode = treeView1.SelectNode;

            Assert.AreEqual("Child 1", selectedNode.Text);
        }
Пример #6
0
        public void TestFormsTreeNodeFindItemTexts()
        {
            FormsTreeView treeView1 = new FormsTreeView(testDlg["treeView1"]());

            string[]      texts = { @"Parent" };
            FormsTreeNode item  = treeView1.FindItem(texts);

            Assert.AreEqual(@"Parent", item.Text);
        }
Пример #7
0
        public void TestStringText()
        {
            FormsTreeView treeView1 = new FormsTreeView(testDlg["treeView1"]());
            FormsTreeNode item      = treeView1.FindItem("Parent");

            treeView1.EmulateNodeSelect(item);
            FormsTreeNode selectitem = treeView1.SelectNode;

            Assert.AreEqual("Parent", selectitem.Text);
        }
Пример #8
0
        public void TestEmulateCollapse()
        {
            //非同期
            FormsTreeView treeView1 = new FormsTreeView(testDlg["treeView1"]());

            app[GetType(), "TreeViewAfterCollapse"](treeView1.AppVar);
            FormsTreeNode item = treeView1.FindItem("Parent");

            item.EmulateCollapse(new Async());
            new NativeMessageBox(testDlg.WaitForNextModal()).EmulateButtonClick("OK");
            Assert.AreEqual(false, item.IsExpanded);
        }
Пример #9
0
        public void TestEmulateEditLabel()
        {
            FormsTreeView treeView1 = new FormsTreeView(testDlg["treeView1"]());
            FormsTreeNode item      = treeView1.FindItem("Parent");

            item.EmulateEditLabel(@"ChangeText");
            Assert.AreEqual(@"ChangeText", item.Text);

            //非同期
            app[GetType(), "TreeViewAfterLabelEditEvent"](treeView1.AppVar);
            item.EmulateEditLabel(@"Parent", new Async());
            new NativeMessageBox(testDlg.WaitForNextModal()).EmulateButtonClick("OK");
            Assert.AreEqual(@"Parent", item.Text);
        }
Пример #10
0
        public void TestNodeEmulateSelect()
        {
            FormsTreeView treeView1 = new FormsTreeView(testDlg["treeView1"]());

            treeView1.FindItem("Parent").EmulateSelect();
            FormsTreeNode selectitem = treeView1.SelectNode;

            Assert.AreEqual("Parent", selectitem.Text);

            //非同期
            app[GetType(), "TreeViewAfterSelectEvent"](treeView1.AppVar);
            treeView1.GetItem(0, 1).EmulateSelect(new Async());
            new NativeMessageBox(testDlg.WaitForNextModal()).EmulateButtonClick("OK");
            FormsTreeNode selectitem2 = treeView1.SelectNode;

            Assert.AreEqual("Child 2", selectitem2.Text);
        }