public void GetNextViewDateTest()
        {
            SchedulerMonthViewModel_Accessor target = new SchedulerMonthViewModel_Accessor(null, null);
            DateTime date = new DateTime(2010, 1, 1);

            Assert.AreEqual(date.AddMonths(1), target.GetNextViewDate(date), "Date should be 2/1/2010.");
        }
        public void CreateElementsTest()
        {
            SchedulerViewModel scheduler = new SchedulerViewModel(null, new CultureInfo("en-US"), false, false);
            SchedulerMonthViewModel_Accessor target = new SchedulerMonthViewModel_Accessor(scheduler, null);

            Assert.IsNull(target.Elements, "HeaderElements should be null.");

            target.InitializeModel(new DateTime(2010, 1, 1));
            target.CreateElements();

            Assert.IsNotNull(target.Elements, "HeaderElements should be initialized.");
        }
        public void CreateElementsTest()
        {
            SchedulerViewModel scheduler            = new SchedulerViewModel(null, new CultureInfo("en-US"), false, false);
            SchedulerMonthViewModel_Accessor target = new SchedulerMonthViewModel_Accessor(scheduler, null);

            Assert.IsNull(target.Elements, "HeaderElements should be null.");

            target.InitializeModel(new DateTime(2010, 1, 1));
            target.CreateElements();

            Assert.IsNotNull(target.Elements, "HeaderElements should be initialized.");
        }
        public void InitializeModelTest()
        {
            SchedulerViewModel scheduler            = new SchedulerViewModel(null, new CultureInfo("en-US"), false, false);
            SchedulerMonthViewModel_Accessor target = new SchedulerMonthViewModel_Accessor(scheduler, null);
            DateTime date = new DateTime(2010, 1, 1);

            Assert.IsNull(target.month, "week should be null.");

            target.InitializeModel(date);

            Assert.IsNotNull(target.month, "day should be initialized.");
            Assert.AreEqual(new DateTime(2009, 12, 28), target.month.Weeks[0].Days[0].Date, "Date should be 12/28/2009.");
        }
        public void SetDisplayedDateCaptionTest()
        {
            SchedulerViewModel scheduler            = new SchedulerViewModel(null, new CultureInfo("en-US"), false, false);
            SchedulerMonthViewModel_Accessor target = new SchedulerMonthViewModel_Accessor(scheduler, null);

            target.InitializeModel(new DateTime(2010, 1, 1));

            Assert.IsNull(scheduler.DisplayedDate, "DisplayedDate should be null.");

            target.SetDisplayedDateCaption();

            Assert.IsNotNull(scheduler.DisplayedDate, "DisplayedDate should be set.");
        }
        public void SetTodayTest()
        {
            SchedulerViewModel scheduler            = new SchedulerViewModel(null, new CultureInfo("en-US"), false, false);
            SchedulerMonthViewModel_Accessor target = new SchedulerMonthViewModel_Accessor(scheduler, null);
            DateTime date = new DateTime(2010, 1, 1);

            target.InitializeModel(date);

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

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

            Assert.IsFalse(target.month.Weeks[0].Days[4].IsToday, "Today should be 1/1/2010.");
        }
        public void SetViewDateTest()
        {
            SchedulerViewModel scheduler            = new SchedulerViewModel(null, new CultureInfo("en-US"), false, false);
            SchedulerMonthViewModel_Accessor target = new SchedulerMonthViewModel_Accessor(scheduler, null);
            DateTime date = new DateTime(2010, 1, 1);

            target.InitializeModel(date);

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

            target.SetViewDate(date.AddMonths(-1));

            Assert.AreEqual(new DateTime(2009, 11, 30), target.month.Weeks[0].Days[0].Date, "Date should be 11/30/2009.");
        }
 public void GetNextViewDateTest()
 {
     SchedulerMonthViewModel_Accessor target = new SchedulerMonthViewModel_Accessor(null, null);
     DateTime date = new DateTime(2010, 1, 1);
     Assert.AreEqual(date.AddMonths(1), target.GetNextViewDate(date), "Date should be 2/1/2010.");
 }
        public void SetViewDateTest()
        {
            SchedulerViewModel scheduler = new SchedulerViewModel(null, new CultureInfo("en-US"), false, false);
            SchedulerMonthViewModel_Accessor target = new SchedulerMonthViewModel_Accessor(scheduler, null);
            DateTime date = new DateTime(2010, 1, 1);
            target.InitializeModel(date);

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

            target.SetViewDate(date.AddMonths(-1));

            Assert.AreEqual(new DateTime(2009, 11, 30), target.month.Weeks[0].Days[0].Date, "Date should be 11/30/2009.");
        }
        public void SetTodayTest()
        {
            SchedulerViewModel scheduler = new SchedulerViewModel(null, new CultureInfo("en-US"), false, false);
            SchedulerMonthViewModel_Accessor target = new SchedulerMonthViewModel_Accessor(scheduler, null);
            DateTime date = new DateTime(2010, 1, 1);
            target.InitializeModel(date);

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

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

            Assert.IsFalse(target.month.Weeks[0].Days[4].IsToday, "Today should be 1/1/2010.");
        }
        public void SetDisplayedDateCaptionTest()
        {
            SchedulerViewModel scheduler = new SchedulerViewModel(null, new CultureInfo("en-US"), false, false);
            SchedulerMonthViewModel_Accessor target = new SchedulerMonthViewModel_Accessor(scheduler, null);
            target.InitializeModel(new DateTime(2010, 1, 1));

            Assert.IsNull(scheduler.DisplayedDate, "DisplayedDate should be null.");

            target.SetDisplayedDateCaption();

            Assert.IsNotNull(scheduler.DisplayedDate, "DisplayedDate should be set.");
        }
        public void InitializeModelTest()
        {
            SchedulerViewModel scheduler = new SchedulerViewModel(null, new CultureInfo("en-US"), false, false);
            SchedulerMonthViewModel_Accessor target = new SchedulerMonthViewModel_Accessor(scheduler, null);
            DateTime date = new DateTime(2010, 1, 1);

            Assert.IsNull(target.month, "week should be null.");

            target.InitializeModel(date);

            Assert.IsNotNull(target.month, "day should be initialized.");
            Assert.AreEqual(new DateTime(2009, 12, 28), target.month.Weeks[0].Days[0].Date, "Date should be 12/28/2009.");
        }