public void TestEmulateCheckEvent()
        {
            if (!isUni || !OSUtility.Is7or8())
            {
                //設定によってはこのイベントは発生しない。
                return;
            }

            NativeTree tree = new NativeTree(testDlg.IdentifyFromDialogId(1041));
            tree.EmulateCheck(tree.Nodes[0], false);
            Assert.IsTrue(EventChecker.IsSameTestEvent(testDlg,
            delegate { tree.EmulateCheck(tree.Nodes[0], true); },
                new CodeInfo(1041, NativeMethods.WM_NOTIFY, TVN_ITEMCHANGING),
                new CodeInfo(1041, NativeMethods.WM_NOTIFY, TVN_ITEMCHANGED)
            ));
            tree.EmulateCheck(tree.Nodes[0], false);
        }
        public void TestEmulateCheckEventAsync()
        {
            if (!isUni || !OSUtility.Is7or8())
            {
                //設定によってはこのイベントは発生しない。
                return;
            }

            NativeTree tree = new NativeTree(testDlg.IdentifyFromDialogId(1042));
            Async async = new Async();
            tree.EmulateCheck(tree.Nodes[0], true, async);
            Assert.IsTrue(0 < MessageBoxUtility.CloseAll(testDlg, async));
        }
        public void TestChecked()
        {
            NativeTree tree = new NativeTree(testDlg.IdentifyFromDialogId(1041));
            tree.EmulateCheck(tree.Nodes[0], true);
            Assert.IsTrue(tree.IsChecked(tree.Nodes[0]));
            tree.EmulateCheck(tree.Nodes[0], false);
            Assert.IsFalse(tree.IsChecked(tree.Nodes[0]));

            //非同期でも同様の効果があることの確認。
            Async a = new Async();
            tree.EmulateCheck(tree.Nodes[0], true, a);
            while (!a.IsCompleted)
            {
                Thread.Sleep(10);
            }
            Assert.IsTrue(tree.IsChecked(tree.Nodes[0]));
        }