public void LoadEventsTest_AllInWindow()
        {
            Day day1 = new Day(DateTime.ParseExact("11-01-2000", "dd-MM-yyyy", CultureInfo.InvariantCulture));
            Day day2 = new Day(DateTime.ParseExact("12-01-2000", "dd-MM-yyyy", CultureInfo.InvariantCulture));

            day1.AddEvent(new Appointment {
                Title = "a"
            });
            day1.AddEvent(new Appointment {
                Title = "b"
            });

            day2.AddEvent(new Appointment {
                Title = "b"
            });

            calendar.AllDays = new List <Day>(new Day[] { day1, day2 });

            ObservableCollection <Day> testList = calendar.LoadEvents(DateTime.ParseExact("11-01-2000", "dd-MM-yyyy", CultureInfo.InvariantCulture),
                                                                      DateTime.ParseExact("07-02-2000", "dd-MM-yyyy", CultureInfo.InvariantCulture));

            Assert.AreEqual(testList.Count, calendar.AllDays.Count, "Alldays in loaded");

            foreach (Day d in calendar.AllDays)
            {
                Assert.IsTrue(testList.Contains(d));
            }
        }
示例#2
0
 private void loadData()
 {
     if (stateManager.load("login") != null)
     {
         CalendarModel.LoadEvents(ActualDay, ActualDay.AddDays(4 * NUMDAYSINWEEK), stateManager.load("login"));
     }
     else
     {
         CalendarModel.Days = new List <Day>();
     }
     Days = LoadEvents();
 }