public void SetDisplayedDateCaptionTest() { SchedulerViewModel scheduler = new SchedulerViewModel(null, new CultureInfo("en-US"), false, false); SchedulerWeekViewModel_Accessor target = new SchedulerWeekViewModel_Accessor(scheduler, null, DisplayedDays.Week); 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); SchedulerWeekViewModel_Accessor target = new SchedulerWeekViewModel_Accessor(scheduler, null, DisplayedDays.Week); DateTime date = new DateTime(2010, 1, 1); Assert.IsNull(target.week, "week should be null."); target.InitializeModel(date); Assert.IsNotNull(target.week, "day should be initialized."); Assert.AreEqual(new DateTime(2009, 12, 28), target.week.Days[0].Date, "Date should be 12/28/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."); }
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 CreateElementsTest() { SchedulerViewModel scheduler = new SchedulerViewModel(null, new CultureInfo("en-US"), false, false); SchedulerWeekViewModel_Accessor target = new SchedulerWeekViewModel_Accessor(scheduler, null, DisplayedDays.Week); Assert.IsNull(target.HeaderElements, "HeaderElements should be null."); Assert.IsNull(target.BorderElements, "BorderElements should be null."); Assert.IsNull(target.BodyElements, "BodyElements should be null."); target.InitializeModel(new DateTime(2010, 1, 1)); target.CreateElements(); Assert.IsNotNull(target.HeaderElements, "HeaderElements should be initialized."); Assert.IsNotNull(target.BorderElements, "BorderElements should be initialized."); Assert.IsNotNull(target.BodyElements, "BodyElements should be initialized."); }