Example #1
0
        public void SetTodayTest()
        {
            SchedulerViewModel scheduler           = new SchedulerViewModel(null, new CultureInfo("en-US"), false, false);
            SchedulerWeekViewModel_Accessor target = new SchedulerWeekViewModel_Accessor(scheduler, null, DisplayedDays.Week);
            DateTime date = new DateTime(2010, 1, 1);

            target.InitializeModel(date);

            Assert.IsTrue(target.week.Days[4].IsToday, "Today should be 1/1/2010.");

            target.SetViewDate(date.AddDays(-7));

            Assert.IsFalse(target.week.Days[4].IsToday, "Today should be 1/1/2010.");
        }
Example #2
0
        public void SetViewDateTest()
        {
            SchedulerViewModel scheduler           = new SchedulerViewModel(null, new CultureInfo("en-US"), false, false);
            SchedulerWeekViewModel_Accessor target = new SchedulerWeekViewModel_Accessor(scheduler, null, DisplayedDays.Week);
            DateTime date = new DateTime(2010, 1, 1);

            target.InitializeModel(date);

            Assert.AreEqual(new DateTime(2009, 12, 28), target.week.Days[0].Date, "Date should be 12/28/2009.");

            target.SetViewDate(date.AddDays(-7));

            Assert.AreEqual(new DateTime(2009, 12, 21), target.week.Days[0].Date, "Date should be 12/21/2009.");
        }
        public void SetViewDateTest()
        {
            SchedulerViewModel scheduler = new SchedulerViewModel(null, new CultureInfo("en-US"), false, false);
            SchedulerWeekViewModel_Accessor target = new SchedulerWeekViewModel_Accessor(scheduler, null, DisplayedDays.Week);
            DateTime date = new DateTime(2010, 1, 1);
            target.InitializeModel(date);

            Assert.AreEqual(new DateTime(2009, 12, 28), target.week.Days[0].Date, "Date should be 12/28/2009.");

            target.SetViewDate(date.AddDays(-7));

            Assert.AreEqual(new DateTime(2009, 12, 21), target.week.Days[0].Date, "Date should be 12/21/2009.");
        }
        public void SetTodayTest()
        {
            SchedulerViewModel scheduler = new SchedulerViewModel(null, new CultureInfo("en-US"), false, false);
            SchedulerWeekViewModel_Accessor target = new SchedulerWeekViewModel_Accessor(scheduler, null, DisplayedDays.Week);
            DateTime date = new DateTime(2010, 1, 1);
            target.InitializeModel(date);

            Assert.IsTrue(target.week.Days[4].IsToday, "Today should be 1/1/2010.");

            target.SetViewDate(date.AddDays(-7));

            Assert.IsFalse(target.week.Days[4].IsToday, "Today should be 1/1/2010.");
        }