public void TestSelectedItemIndexEvent() { NativeTab tab = new NativeTab(testDlg.IdentifyFromDialogId(1022)); Assert.IsTrue(EventChecker.IsSameTestEvent(testDlg, delegate { tab.EmulateSelectItem(1); }, new CodeInfo(1022, NativeMethods.WM_NOTIFY, TCN_SELCHANGING), new CodeInfo(1022, NativeMethods.WM_NOTIFY, TCN_SELCHANGE))); //同じインデックスの場合はイベントは発生しない。 Assert.IsTrue(EventChecker.IsSameTestEvent(testDlg, delegate { tab.EmulateSelectItem(1); })); }
public void TestSelectedItemIndexEventAsync() { NativeTab tab = new NativeTab(testDlg.IdentifyFromDialogId(1023)); Async async = new Async(); tab.EmulateSelectItem(1, async); Assert.IsTrue(0 < MessageBoxUtility.CloseAll(testDlg, async)); }
public void TestSelectedItemIndexValue() { NativeTab tab = new NativeTab(testDlg.IdentifyFromDialogId(1022)); tab.EmulateSelectItem(2); Assert.AreEqual(2, tab.SelectedItemIndex); //非同期でも同様の効果があることを確認 Async a = new Async(); tab.EmulateSelectItem(1, a); while (!a.IsCompleted) { Thread.Sleep(10); } Assert.AreEqual(1, tab.SelectedItemIndex); }