public void DisplayMonthTest() { SchedulerViewModel_Accessor target = new SchedulerViewModel_Accessor(null, new CultureInfo("en-US"), false, false); target.DisplayMonth(); Assert.IsNotNull(target.ViewModels[(int)DisplayMode.Month], "DisplayMonth doesn't create view model for Month."); }
public void SelectDayTest() { SchedulerViewModel_Accessor target = new SchedulerViewModel_Accessor(null, new CultureInfo("en-US"), false, false); SchedulerDayModel day = new SchedulerDayModel(target.displayInfo, new DateTime(2010, 1, 1)); target.SelectDay(day); Assert.IsNotNull(target.ViewModels[(int)DisplayMode.Day], "SelectDay doesn't create view model for Day."); }
public void SelectWeekTest() { SchedulerViewModel_Accessor target = new SchedulerViewModel_Accessor(null, new CultureInfo("en-US"), false, false); SchedulerWeekModel week = new SchedulerWeekModel(target.displayInfo, new DateTime(2010, 1, 1), DisplayedDays.Week); target.SelectWeek(week); Assert.IsNotNull(target.ViewModels[(int)DisplayMode.Week], "SelectWeek doesn't create view model for Week."); }
public void ViewModelsTest() { SchedulerViewModel_Accessor target = new SchedulerViewModel_Accessor(null, new CultureInfo("en-US"), false, false); Assert.IsNull(target.viewModels, "private field viewModel is not null."); int length = target.ViewModels.Length; Assert.IsNotNull(target.viewModels, "private field viewModel is null."); }
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 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 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 CreateViewModelTest() { SchedulerViewModel_Accessor target = new SchedulerViewModel_Accessor(null, new CultureInfo("en-US"), false, false); DateTime date = new DateTime(2001, 1, 1); target.CreateViewModel(DisplayMode.Day, date); Assert.IsNotNull(target.ViewModels[(int)DisplayMode.Day], "CreateViewModel doesn't create view model for Day."); target.CreateViewModel(DisplayMode.Week, date); Assert.IsNotNull(target.ViewModels[(int)DisplayMode.Week], "CreateViewModel doesn't create view model for Week."); target.CreateViewModel(DisplayMode.Month, date); Assert.IsNotNull(target.ViewModels[(int)DisplayMode.Month], "CreateViewModel doesn't create view model for Month."); target.CreateViewModel(DisplayMode.Unspecified, date); Assert.IsNull(target.ViewModels[(int)DisplayMode.Unspecified], "CreateViewModel does create view model for Unspecified."); }
public void CanDisplayWeekTest() { SchedulerViewModel_Accessor target = new SchedulerViewModel_Accessor(null, new CultureInfo("en-US"), false, false); Assert.IsTrue(target.CanDisplayWeek, "Should return true."); }
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 DisplayWeekTest() { SchedulerViewModel_Accessor target = new SchedulerViewModel_Accessor(null, new CultureInfo("en-US"), false, false); target.DisplayWeek(); Assert.IsNotNull(target.ViewModels[(int)DisplayMode.Week], "DisplayWeek doesn't create view model for Week."); }
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); }
public void CanDisplayNextTest() { SchedulerViewModel_Accessor target = new SchedulerViewModel_Accessor(null, new CultureInfo("en-US"), false, false); Assert.IsTrue(target.CanDisplayNext, "Should return true."); }