public void ViewModelTest() { SchedulerViewModel_Accessor target = new SchedulerViewModel_Accessor(null, new CultureInfo("en-US"), false, false); target.InitializeViewModel(DisplayMode.Day); Assert.IsInstanceOfType(target.ViewModel, typeof(SchedulerWeekViewModel), "ViewModel isn't instance DayViewModel."); target.InitializeViewModel(DisplayMode.WorkWeek); Assert.IsInstanceOfType(target.ViewModel, typeof(SchedulerWeekViewModel), "ViewModel isn't instance WeekViewModel."); target.InitializeViewModel(DisplayMode.Week); Assert.IsInstanceOfType(target.ViewModel, typeof(SchedulerWeekViewModel), "ViewModel isn't instance WeekViewModel."); target.InitializeViewModel(DisplayMode.Month); Assert.IsInstanceOfType(target.ViewModel, typeof(SchedulerMonthViewModel), "ViewModel isn't instance MonthViewModel."); }
public void InitializeViewModelTest() { SchedulerViewModel_Accessor target = new SchedulerViewModel_Accessor(null, new CultureInfo("en-US"), false, false); target.InitializeViewModel(DisplayMode.Day); Assert.IsNotNull(target.ViewModels[(int)DisplayMode.Day], "InitializeViewModel doesn't create view model for Day."); target.InitializeViewModel(DisplayMode.Week); Assert.IsNotNull(target.ViewModels[(int)DisplayMode.Week], "InitializeViewModel doesn't create view model for Week."); target.InitializeViewModel(DisplayMode.Month); Assert.IsNotNull(target.ViewModels[(int)DisplayMode.Month], "InitializeViewModel doesn't create view model for Month."); target.InitializeViewModel(DisplayMode.Unspecified); Assert.IsNull(target.ViewModels[(int)DisplayMode.Unspecified], "InitializeViewModel does create view model for Unspecified."); }
public void DisplayNextTest() { SchedulerViewModel_Accessor target = new SchedulerViewModel_Accessor(null, new CultureInfo("en-US"), false, false); DateTime date = new DateTime(2010, 1, 1); target.InitializeViewModel(DisplayMode.Day, date); Assert.AreEqual(date, target.selectedDate); target.DisplayNext(); Assert.AreEqual(date.AddDays(1), target.selectedDate); }
public void InitializeViewModelWithDateTest() { SchedulerViewModel_Accessor target = new SchedulerViewModel_Accessor(null, new CultureInfo("en-US"), false, false); DateTime date = new DateTime(2001, 1, 1); target.InitializeViewModel(DisplayMode.Day, date); Assert.IsNotNull(target.ViewModels[(int)DisplayMode.Day], "InitializeViewModel doesn't create view model for Day."); target.InitializeViewModel(DisplayMode.Week, date); Assert.IsNotNull(target.ViewModels[(int)DisplayMode.Week], "InitializeViewModel doesn't create view model for Week."); target.InitializeViewModel(DisplayMode.Month, date); Assert.IsNotNull(target.ViewModels[(int)DisplayMode.Month], "InitializeViewModel doesn't create view model for Month."); target.InitializeViewModel(DisplayMode.Unspecified, date); Assert.IsNull(target.ViewModels[(int)DisplayMode.Unspecified], "InitializeViewModel does create view model for Unspecified."); }
public void DisplayPreviousTest() { SchedulerViewModel_Accessor target = new SchedulerViewModel_Accessor(null, new CultureInfo("en-US"), false, false); DateTime date = new DateTime(2010, 1, 1); target.InitializeViewModel(DisplayMode.Day, date); Assert.AreEqual(date, target.selectedDate); target.DisplayPrevious(); Assert.AreEqual(date.AddDays(-1), target.selectedDate); }