public void ClickHeaderCommandTest()
 {
     DateTime date = new DateTime(2010, 1, 1);
     SchedulerWeekModel week = new SchedulerWeekModel(new SchedulerDisplayInfo(new CultureInfo("cs-CZ")), date, DisplayedDays.Week);
     SchedulerMonthWeekHeaderViewModel target = new SchedulerMonthWeekHeaderViewModel(null, week);
     Assert.IsInstanceOfType(target.ClickHeaderCommand, typeof(ICommand), "ClickHeaderCommand should return ICommand object.");
 }
        public void ClickHeaderTest()
        {
            WeekSelected weekNotify = new WeekSelected();
            DateTime date = new DateTime(2010, 1, 1);
            SchedulerWeekModel week = new SchedulerWeekModel(new SchedulerDisplayInfo(new CultureInfo("cs-CZ")), date, DisplayedDays.Week);
            week.SetDate(date);
            SchedulerMonthWeekHeaderViewModel target = new SchedulerMonthWeekHeaderViewModel(weekNotify, week);

            Assert.IsNull(weekNotify.Week, "Week should be null.");

            ICommand command = target.ClickHeaderCommand;
            command.Execute(null);

            Assert.IsNotNull(weekNotify.Week, "Week should be assigned.");
            Assert.AreEqual(1, weekNotify.Week.Week, "Date should be 1.");
        }
 private void InitWeekNumberCells(List<SchedulerBaseElementViewModel> elementList)
 {
     int row = 2;
     foreach (SchedulerWeekModel week in month.Weeks)
     {
         SchedulerMonthWeekHeaderViewModel header = new SchedulerMonthWeekHeaderViewModel(scheduler, week);
         header.Row = row;
         elementList.Add(header);
         row += 2;
     }
 }
        public void WeekTest()
        {
            DateTime date = new DateTime(2010, 1, 1);
            SchedulerWeekModel model = new SchedulerWeekModel(new SchedulerDisplayInfo(new CultureInfo("en-US")), date, DisplayedDays.Week);
            model.SetDate(date);
            SchedulerMonthWeekHeaderViewModel target = new SchedulerMonthWeekHeaderViewModel(null, model);
            Assert.AreEqual(1, target.Week, "Week isn't 1.");

            try
            {
                target.PropertyChanged += new PropertyChangedEventHandler(OnPropertyChanged);

                PreparePropertyChangedTest();
                model.SetDate(date.AddDays(7));
                Assert.IsTrue(NotifiedProperties.Contains("Week"), "PropertyChanged event wasn't raised on property 'Week' changing to 2.");
                Assert.AreEqual(2, target.Week, "Week isn't 2.");
            }
            finally
            {
                target.PropertyChanged -= new PropertyChangedEventHandler(OnPropertyChanged);
            }
        }