private void GetComparingCalendars() { //Regex emailFormat = new Regex(@"[\w-]+@([\w-]+\.)+[\w-]+"); //if (!string.IsNullOrEmpty(mailAddress) && mailIDPattern.IsMatch(mailAddress)) if (_ComparingCalendarsList != null) { List <String> emailList = convertEmailStringToList(_ComparingCalendarsList); ComparingEvents = service.GetComparingEvents(calendar, period.Today(), emailList, _SelectedviewFormat, _primaryEmail); ComparingEvents = service.FormatEventsDatesStringRepresentation(ComparingEvents, repository.GetDateTimePreferences()); SortAndFilterEvents(); eventListType = EventsListType.Today; ShowResults(); } //} }
public void GetComparingEventsTest() { List <string> s = new List <string>(); s.Add("*****@*****.**"); s.Add("*****@*****.**"); //CalendarEventList events = calendar.GetComparingEvents(DateTime.Today, DateTime.Today, s, "Free Busy View"); CalendarEventList events = service.GetComparingEvents(calendar, period.Today(), s, "Free Busy View", false); CalendarEvent ev = new CalendarEvent("", "all free until ", "", new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 9, 0, 0), new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 10, 0, 0)); CalendarEvent ev2 = new CalendarEvent("", "all free until ", "", new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 12, 30, 0), new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 2, 0, 0).AddHours(12)); CalendarEventList l = new CalendarEventList(); l.Add(ev); l.Add(ev2); Console.WriteLine("################################################################################"); Console.WriteLine("test result " + events.Count); //Assert.AreEqual(l, events, "Events are not equal " + events.Count); }