public void TestGetDayByDateTime() { DateTime dateTime1 = new DateTime(2012, 3, 15); DateTime dateTime2 = new DateTime(2012, 4, 11); Agenda agenda1 = new Agenda(dateTime1); agenda1.Title = "dateTime1"; Agenda agenda2 = new Agenda(dateTime2); agenda2.Title = "dateTime2"; Agenda agenda3 = new Agenda(dateTime1); agenda3.Title = "dateTime1"; Agenda agenda4 = new Agenda(dateTime2); agenda4.Title = "dateTime2"; Agenda agenda5 = new Agenda(dateTime1); agenda5.Title = "dateTime1"; _agendas.AddAgenda(agenda1); _agendas.AddAgenda(agenda2); _agendas.AddAgenda(agenda3); _agendas.AddAgenda(agenda4); _agendas.AddAgenda(agenda5); DayAgenda day = _agendas.GetDay(dateTime1); Assert.AreEqual(3, day.Count); for (int i = 0; i < day.Count; i++) { Assert.AreEqual("dateTime1", day[i].Title); } }
public void TestConstructorByList() { DateTime dateTime = new DateTime(2012, 1, 2); //List<Agenda> agendaList = new List<Agenda>(); Agendas agendas = new Agendas(); Agenda agenda1 = new Agenda(dateTime); agenda1.Title = "agenda1"; Agenda agenda2 = new Agenda(dateTime); agenda2.Title = "agenda2"; Agenda agenda3 = new Agenda(dateTime); agenda3.Title = "agenda3"; Agenda agenda4 = new Agenda(dateTime); agenda4.Title = "agenda4"; Agenda agenda5 = new Agenda(dateTime); agenda5.Title = "agenda5"; agendas.AddAgenda(agenda1); agendas.AddAgenda(agenda2); agendas.AddAgenda(agenda3); agendas.AddAgenda(agenda4); agendas.AddAgenda(agenda5); DayAgenda day = new DayAgenda(agendas, dateTime); Assert.AreEqual(5, day.Count); }
public void TestPropertyChanged() { DateTime dateTime = new DateTime(2012, 12, 21); DateTime notDateTime = new DateTime(2000, 1, 1); DayAgenda dayAgenda = new DayAgenda(_agendas, dateTime); Agenda agenda1 = new Agenda(dateTime); Agenda agenda2 = new Agenda(notDateTime); Assert.AreEqual(0, dayAgenda.Count); _agendas.AddAgenda(agenda1); Assert.AreEqual(1, dayAgenda.Count); _agendas.AddAgenda(agenda2); Assert.AreEqual(1, dayAgenda.Count); }
public void TestConstructor() { DayAgenda dayAgenda = new DayAgenda(_agendas, new DateTime(2012, 12, 21)); Assert.AreEqual(0, dayAgenda.Count); }