public void TestScrollPosEvent()
        {
            NativeScrollBar hscroll = new NativeScrollBar(testDlg.IdentifyFromDialogId(1027));
            Assert.IsTrue(EventChecker.IsSameTestEvent(testDlg,
                delegate { hscroll.EmulateScroll(30); },
                new CodeInfo(1027, NativeMethods.WM_HSCROLL, SB_THUMBTRACK, 30),
                new CodeInfo(1027, NativeMethods.WM_HSCROLL, SB_THUMBPOSITION, 30),
                new CodeInfo(1027, NativeMethods.WM_HSCROLL, SB_ENDSCROLL, 0)));

            NativeScrollBar vscroll = new NativeScrollBar(testDlg.IdentifyFromDialogId(1028));
            Assert.IsTrue(EventChecker.IsSameTestEvent(testDlg,
                delegate { vscroll.EmulateScroll(30); },
                new CodeInfo(1028, NativeMethods.WM_VSCROLL, SB_THUMBTRACK, 30),
                new CodeInfo(1028, NativeMethods.WM_VSCROLL, SB_THUMBPOSITION, 30),
                new CodeInfo(1028, NativeMethods.WM_VSCROLL, SB_ENDSCROLL, 0)));
        }
 public void TestScrollPosEventAsync()
 {
     //非同期実行。
     NativeScrollBar scroll = new NativeScrollBar(testDlg.IdentifyFromDialogId(1029));
     Async async = new Async();
     scroll.EmulateScroll(20, async);
     Assert.IsTrue(0 < MessageBoxUtility.CloseAll(testDlg, async));
 }
        public void TestScrollPosValue()
        {
            NativeScrollBar hscroll = new NativeScrollBar(testDlg.IdentifyFromDialogId(1027));
            hscroll.EmulateScroll(30);
            Assert.AreEqual(30, hscroll.ScrollPos);

            NativeScrollBar vscroll = new NativeScrollBar(testDlg.IdentifyFromDialogId(1028));
            vscroll.EmulateScroll(30);
            Assert.AreEqual(30, vscroll.ScrollPos);

            //非同期で実行しても同様の効果があることを確認。
            Async a = new Async();
            vscroll.EmulateScroll(50, a);
            while (!a.IsCompleted)
            {
                Thread.Sleep(10);
            }
            Assert.AreEqual(50, vscroll.ScrollPos);
        }