public void TestEmulateChangeCurrentSelectedIndexEventAsync()
 {
     NativeListBox listBox = new NativeListBox(testDlg.IdentifyFromDialogId(1038));
     Async async = new Async();
     listBox.EmulateChangeCurrentSelectedIndex(1, async);
     Assert.IsTrue(0 < MessageBoxUtility.CloseAll(testDlg, async));
 }
        public void TestCurrentSelectedIndexValue()
        {
            NativeListBox listBox = new NativeListBox(testDlg.IdentifyFromDialogId(1037));
            listBox.EmulateChangeCurrentSelectedIndex(1);
            Assert.AreEqual(1, listBox.CurrentSelectedIndex);

            //非同期でも正常に動作することを確認。
            Async a = new Async();
            listBox.EmulateChangeCurrentSelectedIndex(2, a);
            while (!a.IsCompleted)
            {
                Thread.Sleep(10);
            }
            Assert.AreEqual(2, listBox.CurrentSelectedIndex);
        }
 public void TestEmulateChangeCurrentSelectedIndexEvent()
 {
     //LBN_SELCHANGEが発生していることを確認。
     NativeListBox listBox = new NativeListBox(testDlg.IdentifyFromDialogId(1037));
     listBox.EmulateChangeCurrentSelectedIndex(0);
     Assert.IsTrue(EventChecker.IsSameTestEvent(testDlg,
         delegate { listBox.EmulateChangeCurrentSelectedIndex(1); },
         new CodeInfo(1037, NativeMethods.WM_COMMAND, LBN_SELCHANGE)));
 }