public void TestPosEvent()
        {
            NativeSlider slider = new NativeSlider(testDlg.IdentifyFromDialogId(1019));
            NativeSlider vslider = new NativeSlider(testDlg.IdentifyFromDialogId(1026));

            //同期実行。
            Assert.IsTrue(EventChecker.IsSameTestEvent(testDlg,
                delegate { slider.EmulateChangePos(100); },
                new CodeInfo(1019, NativeMethods.WM_NOTIFY, TRBN_THUMBPOSCHANGING),
                new CodeInfo(1019, NativeMethods.WM_HSCROLL, SB_THUMBPOSITION, 100)));

            //同期実行 縦方向。
            Assert.IsTrue(EventChecker.IsSameTestEvent(testDlg,
                delegate { vslider.EmulateChangePos(100); },
                new CodeInfo(1026, NativeMethods.WM_NOTIFY, TRBN_THUMBPOSCHANGING),
                new CodeInfo(1026, NativeMethods.WM_VSCROLL, SB_THUMBPOSITION, 100)));

            //詳細な通知内容の確認。
            NMTRBTHUMBPOSCHANGING[] expectation = new NMTRBTHUMBPOSCHANGING[1];
            expectation[0].nReason = TB_THUMBTRACK;
            expectation[0].dwPos = 150;
            Assert.IsTrue(EventChecker.CheckNotifyDetail(testDlg,
                delegate { slider.EmulateChangePos(150); },
                expectation));
        }
 public void TestPosEventAsync()
 {
     NativeSlider slider = new NativeSlider(testDlg.IdentifyFromDialogId(1020));
     Async async = new Async();
     slider.EmulateChangePos(100, async);
     Assert.IsTrue(0 < MessageBoxUtility.CloseAll(testDlg, async));
 }
        public void TestPosValue()
        {
            NativeSlider slider = new NativeSlider(testDlg.IdentifyFromDialogId(1019));
            slider.EmulateChangePos(150);
            Assert.AreEqual(150, slider.Pos);

            //非同期でも同様の効果があることを確認。
            Async a = new Async();
            slider.EmulateChangePos(200, a);
            while (!a.IsCompleted)
            {
                Thread.Sleep(10);
            }
            Assert.AreEqual(200, slider.Pos);
        }