Exemplo n.º 1
0
        public void TodayTest()
        {
            FormsMonthCalendar monthcalendar = new FormsMonthCalendar(testDlg["monthCalendar1"]());
            DateTime           datetime      = monthcalendar.Today;

            Assert.AreEqual(DateTime.Today, datetime);
        }
Exemplo n.º 2
0
        public void MaxSelectionCountTest()
        {
            FormsMonthCalendar monthcalendar = new FormsMonthCalendar(testDlg["monthCalendar1"]());
            int maxcount = monthcalendar.MaxSelectionCount;

            Assert.AreEqual(7, maxcount);
        }
Exemplo n.º 3
0
        public void FirstDayOfWeekTest()
        {
            FormsMonthCalendar monthcalendar = new FormsMonthCalendar(testDlg["monthCalendar1"]());
            Day day = monthcalendar.FirstDayOfWeek;

            Assert.AreEqual(Day.Default, day);
        }
Exemplo n.º 4
0
        static void Assert(string accessPath, FormsMonthCalendar monthCalendar)
        {
            CaptureAdaptor.AddUsing(typeof(DateTime).Namespace);
            var value = monthCalendar.SelectedDay;

            CaptureAdaptor.AddCode($"{accessPath}.SelectedDay.Date.Is(new DateTime({value.Year}, {value.Month}, {value.Day}));");
        }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
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);
        }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
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);
        }