public static void testEvent() { GService g = new GService(); // these always need to be changed before testing string uuid = "UUIDTESTefefERezfzesefeKE12&"; string uuid2 = "efeefefe"; string uuid3 = "efefefefefef"; string calendarName = "test12345634567VIJF"; Person testPerson = makePerson("testName2", "TestLastName", "*****@*****.**"); Attendee.InewAttendee(testPerson, uuid, "1"); IList <EventAttendee> attendees = new List <EventAttendee>(); EventAttendee test = new EventAttendee() { //Email = "testname2", DisplayName = "*****@*****.**" }; IList <string> UUIDS = new List <string>(); UUIDS.Add(testPerson.UserDefined[0].Value); Console.WriteLine("attendee created"); Console.ReadKey(); //create event //create calendar var testCalendar = Calendarss.InewCalendar(makeCalendar(calendarName), uuid3, "1"); DateTime start = new DateTime(2019, 5, 7, 14, 30, 0); DateTime end = new DateTime(2019, 5, 7, 15, 30, 0); Google.Apis.Calendar.v3.Data.Event ev = makeEvent("1223432123HG23F2V32H2", "tesstlocation", "testDisc", start, end, convertPersonToAttendee(UUIDS)); Eventss.InewEvent(ev, uuid3, uuid2, "1"); Console.WriteLine("event created"); Console.ReadKey(); //update event ev.Summary = "newTestsSummery"; Eventss.IupdateEventById(ev, uuid3, uuid2, "2"); Console.WriteLine("event updated"); Console.ReadKey(); //delete event Eventss.IDeleteEventById(uuid2, uuid3); Calendarss.IdeleteCalendarById(uuid3); Console.WriteLine("event deleted"); Console.ReadKey(); }
// Delete a calendar using PlanningLibrary (layered code on google calendar) public void deleteCalendar(XmlDocument doc) { // Parsing data from XmlDocument XmlNodeList id = doc.GetElementsByTagName("UUID"); // Logging parsed data Console.WriteLine(id[0].InnerText); // Delete a calendar, filled with parsed data from XmlDocument and finally sent with PlanningLibrary method. // Expects a UUID Calendarss.IdeleteCalendarById(id[0].InnerText); Console.WriteLine("Event successfully deleted"); ControlRoom.SendConfirmationMessage("Planning: Event successfully deleted"); }
public static void testCalendar() { GService g = new GService(); string uuid = "testUUID3"; //create calendar //!ALways change the UUID! var testCalendar = Calendarss.InewCalendar(makeCalendar("calTest"), uuid, "1"); Console.WriteLine("calendar created"); Console.ReadKey(); //update Calendar testCalendar.Summary = "updateCalTest"; Calendarss.IupdateCalendarById(testCalendar, uuid, "2"); Console.WriteLine("calendar updated"); Console.ReadKey(); //delete Calendar Calendarss.IdeleteCalendarById(uuid); Console.WriteLine("calendar deleted"); Console.ReadKey(); }