Example #1
0
        public void EmulateSelectDayTest()
        {
            FormsMonthCalendar monthcalendar = new FormsMonthCalendar(testDlg["monthCalendar1"]());

            monthcalendar.EmulateSelectDay(new DateTime(2013, 10, 30));
            DateTime datetime = monthcalendar.SelectedDay;

            Assert.AreEqual(new DateTime(2013, 10, 30), datetime);
            // 非同期
            app[GetType(), "ChangeDateTimeEvent"](monthcalendar.AppVar);
            monthcalendar.EmulateSelectDay(new DateTime(2013, 10, 25), new Async());
            new NativeMessageBox(testDlg.WaitForNextModal()).EmulateButtonClick("OK");
            datetime = monthcalendar.SelectedDay;
            Assert.AreEqual(new DateTime(2013, 10, 25), datetime);
        }
Example #2
0
        public void SelectedDayTest()
        {
            FormsMonthCalendar monthcalendar = new FormsMonthCalendar(testDlg["monthCalendar1"]());

            monthcalendar.EmulateSelectDay(new DateTime(2013, 10, 22));

            DateTime datetime = monthcalendar.SelectedDay;

            Assert.AreEqual(new DateTime(2013, 10, 22), datetime);
        }
Example #3
0
        public void EmulateSelectDaysTest()
        {
            FormsMonthCalendar monthcalendar = new FormsMonthCalendar(testDlg["monthCalendar1"]());

            monthcalendar.EmulateSelectDay(new DateTime(2013, 10, 28), new DateTime(2013, 10, 31));
            DateTime min = new DateTime();
            DateTime max = new DateTime();

            monthcalendar.GetSelectionRange(ref min, ref max);
            Assert.AreEqual(new DateTime(2013, 10, 28), min);
            Assert.AreEqual(new DateTime(2013, 10, 31), max);
            // 非同期
            app[GetType(), "ChangeDateTimeEvent"](monthcalendar.AppVar);
            monthcalendar.EmulateSelectDay(new DateTime(2013, 10, 25), new DateTime(2013, 10, 27), new Async());
            new NativeMessageBox(testDlg.WaitForNextModal()).EmulateButtonClick("OK");
            monthcalendar.GetSelectionRange(ref min, ref max);
            Assert.AreEqual(new DateTime(2013, 10, 25), min);
            Assert.AreEqual(new DateTime(2013, 10, 27), max);
        }
Example #4
0
        public void GetSelectionRangeTest()
        {
            FormsMonthCalendar monthcalendar = new FormsMonthCalendar(testDlg["monthCalendar1"]());
            DateTime           datetimeStart = new DateTime();
            DateTime           datetimeEnd   = new DateTime();

            monthcalendar.EmulateSelectDay(new DateTime(2013, 10, 25));
            monthcalendar.GetSelectionRange(ref datetimeStart, ref datetimeEnd);
            Assert.AreEqual(new DateTime(2013, 10, 25), datetimeStart);
            Assert.AreEqual(new DateTime(2013, 10, 25), datetimeEnd);
        }