public async void Calendars_DeleteEvent_DeletesExistingEvent() { var calendarEvent = new CalendarEvent { Name = "Bob", Start = DateTime.Now.AddDays(5), End = DateTime.Now.AddDays(5).AddHours(2), AllDay = false }; var calendar = await _service.CreateCalendarAsync(_calendarName); await _service.AddOrUpdateEventAsync(calendar, calendarEvent); Assert.IsTrue(await _service.DeleteEventAsync(calendar, calendarEvent)); Assert.IsNull(await _service.GetEventByIdAsync(calendarEvent.ExternalID)); }
public async Task Calendars_AddOrUpdateEvent_NonexistentEventCreatesNew() { var calendarEvent = GetTestEvent(); var calendar = new Calendar { Name = _calendarName }; await _service.AddOrUpdateCalendarAsync(calendar); // Create and delete an event so that we have a valid event ID for a nonexistent event // await _service.AddOrUpdateEventAsync(calendar, calendarEvent); await _service.DeleteEventAsync(calendar, calendarEvent); await _service.AddOrUpdateEventAsync(calendar, calendarEvent); var eventFromId = await _service.GetEventByIdAsync(calendarEvent.ExternalID); Assert.IsNotNull(eventFromId); }