public void TestViewEvent() { if (!NativeMethods.IsWindowUnicode(testDlg.Handle) || !OSUtility.Is7or8()) { return; } NativeMonthCalendar calendar = new NativeMonthCalendar(testDlg.IdentifyFromDialogId(1033)); Assert.IsTrue(EventChecker.IsSameTestEvent(testDlg, delegate { calendar.EmulateChangeView(MonthCalendarView.Year); }, new CodeInfo(1033, NativeMethods.WM_NOTIFY, MCN_VIEWCHANGE))); }
public void TestViewEventAsync() { if (!NativeMethods.IsWindowUnicode(testDlg.Handle) || !OSUtility.Is7or8()) { return; } NativeMonthCalendar calendar = new NativeMonthCalendar(testDlg.IdentifyFromDialogId(1032)); Async async = new Async(); calendar.EmulateChangeView(MonthCalendarView.Year, async); Assert.IsTrue(0 < MessageBoxUtility.CloseAll(testDlg, async)); ; }
public void TestViewValue() { NativeMonthCalendar calendar = new NativeMonthCalendar(testDlg.IdentifyFromDialogId(1033)); if (!NativeMethods.IsWindowUnicode(testDlg.Handle) || !OSUtility.Is7or8()) { return; } calendar.EmulateChangeView(MonthCalendarView.Year); Assert.AreEqual(MonthCalendarView.Year, calendar.MonthCalendarView); //非同期でも同様の効果があることを確認。 Async a = new Async(); calendar.EmulateChangeView(MonthCalendarView.Decade, a); while (!a.IsCompleted) { Thread.Sleep(10); } Assert.AreEqual(MonthCalendarView.Decade, calendar.MonthCalendarView); }