From: Steve Brokenshire Date: Tue, 3 Jan 2017 20:17:53 +0000 (+0000) Subject: CalendarDataStorage: Added unit tests for calendar descriptions X-Git-Tag: release-0.02~39 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=b760adada52bf30e56c5c79605757b79e6f6034b;p=xestiacalendar%2F.git CalendarDataStorage: Added unit tests for calendar descriptions --- diff --git a/source/tests/xestiacalendar_calendardatastorage.h b/source/tests/xestiacalendar_calendardatastorage.h index c75ca72..ee0a234 100644 --- a/source/tests/xestiacalendar_calendardatastorage.h +++ b/source/tests/xestiacalendar_calendardatastorage.h @@ -283,7 +283,7 @@ TEST(CalendarDataStorage, Add_One_Calendar_To_One_Account){ AddCalendarTest.AddAccount("Test Account 1"); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); } @@ -293,8 +293,8 @@ TEST(CalendarDataStorage, Add_Two_Calendars_To_One_Account){ AddCalendarTest.AddAccount("Test Account 1"); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description")); } @@ -304,9 +304,9 @@ TEST(CalendarDataStorage, Add_Three_Calendars_To_One_Account){ AddCalendarTest.AddAccount("Test Account 1"); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description")); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description")); } @@ -317,9 +317,9 @@ TEST(CalendarDataStorage, Add_One_Calendar_To_Two_Accounts){ AddCalendarTest.AddAccount("Test Account 1"); AddCalendarTest.AddAccount("Test Account 2"); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 1", "calendar1-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); } @@ -330,11 +330,11 @@ TEST(CalendarDataStorage, Add_Two_Calendars_To_Two_Accounts){ AddCalendarTest.AddAccount("Test Account 1"); AddCalendarTest.AddAccount("Test Account 2"); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description")); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 2", "calendar2-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description")); } @@ -345,13 +345,13 @@ TEST(CalendarDataStorage, Add_Three_Calendars_To_Two_Accounts){ AddCalendarTest.AddAccount("Test Account 1"); AddCalendarTest.AddAccount("Test Account 2"); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description")); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description")); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 2", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 3", "calendar3-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description")); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description")); } @@ -363,11 +363,11 @@ TEST(CalendarDataStorage, Add_One_Calendar_To_Three_Accounts){ AddCalendarTest.AddAccount("Test Account 2"); AddCalendarTest.AddAccount("Test Account 3"); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 1", "calendar1-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 1", "calendar1-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); } @@ -379,14 +379,14 @@ TEST(CalendarDataStorage, Add_Two_Calendars_To_Three_Accounts){ AddCalendarTest.AddAccount("Test Account 2"); AddCalendarTest.AddAccount("Test Account 3"); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description")); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 2", "calendar2-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description")); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 2", "calendar2-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description")); } @@ -398,17 +398,17 @@ TEST(CalendarDataStorage, Add_Three_Calendars_To_Three_Accounts){ AddCalendarTest.AddAccount("Test Account 2"); AddCalendarTest.AddAccount("Test Account 3"); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description")); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description")); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 2", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 3", "calendar3-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description")); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description")); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 2", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 3", "calendar3-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description")); + ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description")); } @@ -418,9 +418,9 @@ TEST(CalendarDataStorage, Get_Calendar_Information_From_One_Account){ GetCalendarTest.AddAccount("Test Account 1"); - ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1")); + ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description 2")); + ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description 3")); CDSGetCalendarInfo calendar1Info; CDSGetCalendarInfo calendar2Info; @@ -455,8 +455,12 @@ TEST(CalendarDataStorage, Get_Calendar_Information_From_One_Account){ ASSERT_EQ("calendar3-test", calendar3Info.calendarTextID); ASSERT_EQ("Test Account 1", calendar1Info.accountName); - ASSERT_EQ("Test Account 1", calendar1Info.accountName); - ASSERT_EQ("Test Account 1", calendar1Info.accountName); + ASSERT_EQ("Test Account 1", calendar2Info.accountName); + ASSERT_EQ("Test Account 1", calendar3Info.accountName); + + ASSERT_EQ("Calendar Description 1", calendar1Info.calendarDescription); + ASSERT_EQ("Calendar Description 2", calendar2Info.calendarDescription); + ASSERT_EQ("Calendar Description 3", calendar3Info.calendarDescription); } @@ -467,13 +471,13 @@ TEST(CalendarDataStorage, Get_Calendar_Information_From_Two_Accounts){ GetCalendarTest.AddAccount("Test Account 1"); GetCalendarTest.AddAccount("Test Account 2"); - ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1")); + ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description 2")); + ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description 3")); - ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 2", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 3", "calendar3-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 4")); + ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description 5")); + ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description 6")); CDSGetCalendarInfo calendar1Info; CDSGetCalendarInfo calendar2Info; @@ -547,6 +551,13 @@ TEST(CalendarDataStorage, Get_Calendar_Information_From_Two_Accounts){ ASSERT_EQ("Test Account 2", calendar5Info.accountName); ASSERT_EQ("Test Account 2", calendar6Info.accountName); + ASSERT_EQ("Calendar Description 1", calendar1Info.calendarDescription); + ASSERT_EQ("Calendar Description 2", calendar2Info.calendarDescription); + ASSERT_EQ("Calendar Description 3", calendar3Info.calendarDescription); + ASSERT_EQ("Calendar Description 4", calendar4Info.calendarDescription); + ASSERT_EQ("Calendar Description 5", calendar5Info.calendarDescription); + ASSERT_EQ("Calendar Description 6", calendar6Info.calendarDescription); + } TEST(CalendarDataStorage, Get_Calendar_Information_From_Three_Accounts){ @@ -557,17 +568,17 @@ TEST(CalendarDataStorage, Get_Calendar_Information_From_Three_Accounts){ GetCalendarTest.AddAccount("Test Account 2"); GetCalendarTest.AddAccount("Test Account 3"); - ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1")); + ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description 2")); + ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description 3")); - ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 2", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 3", "calendar3-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 4")); + ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description 5")); + ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description 6")); - ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 2", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 3", "calendar3-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 7")); + ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description 8")); + ASSERT_EQ(CDSCALENDAR_OK, GetCalendarTest.AddCalendar(GetCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description 9")); CDSGetCalendarInfo calendar1Info; CDSGetCalendarInfo calendar2Info; @@ -677,6 +688,18 @@ TEST(CalendarDataStorage, Get_Calendar_Information_From_Three_Accounts){ ASSERT_EQ("Test Account 3", calendar8Info.accountName); ASSERT_EQ("Test Account 3", calendar9Info.accountName); + ASSERT_EQ("Calendar Description 1", calendar1Info.calendarDescription); + ASSERT_EQ("Calendar Description 2", calendar2Info.calendarDescription); + ASSERT_EQ("Calendar Description 3", calendar3Info.calendarDescription); + + ASSERT_EQ("Calendar Description 4", calendar4Info.calendarDescription); + ASSERT_EQ("Calendar Description 5", calendar5Info.calendarDescription); + ASSERT_EQ("Calendar Description 6", calendar6Info.calendarDescription); + + ASSERT_EQ("Calendar Description 7", calendar7Info.calendarDescription); + ASSERT_EQ("Calendar Description 8", calendar8Info.calendarDescription); + ASSERT_EQ("Calendar Description 9", calendar9Info.calendarDescription); + } TEST(CalendarDataStorage, Update_One_Calendar_With_One_Account){ @@ -685,12 +708,13 @@ TEST(CalendarDataStorage, Update_One_Calendar_With_One_Account){ UpdateCalendarTest.AddAccount("Test Account 1"); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1")); CDSGetCalendarInfo calendar1Info = UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test"); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar1Info.calendarID, "Calendar 1 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar1Info.calendarID, "Calendar 1 Updated", DefaultColour, "Calendar Description 1 Updated")); ASSERT_EQ("Calendar 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test").calendarName); + ASSERT_EQ("Calendar Description 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test").calendarDescription); } @@ -701,17 +725,20 @@ TEST(CalendarDataStorage, Update_One_Calendar_With_Two_Accounts){ UpdateCalendarTest.AddAccount("Test Account 1"); UpdateCalendarTest.AddAccount("Test Account 2"); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 1", "calendar1-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 2")); CDSGetCalendarInfo calendar1Info = UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test"); CDSGetCalendarInfo calendar2Info = UpdateCalendarTest.GetCalendar("Test Account 2", "calendar1-test"); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar1Info.calendarID, "Calendar 1 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar2Info.calendarID, "Calendar 1 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar1Info.calendarID, "Calendar 1 Updated", DefaultColour, "Calendar Description 1 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar2Info.calendarID, "Calendar 1 Updated", DefaultColour, "Calendar Description 2 Updated")); ASSERT_EQ("Calendar 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test").calendarName); ASSERT_EQ("Calendar 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 2", "calendar1-test").calendarName); + + ASSERT_EQ("Calendar Description 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test").calendarDescription); + ASSERT_EQ("Calendar Description 2 Updated", UpdateCalendarTest.GetCalendar("Test Account 2", "calendar1-test").calendarDescription); } @@ -723,22 +750,26 @@ TEST(CalendarDataStorage, Update_One_Calendar_With_Three_Accounts){ UpdateCalendarTest.AddAccount("Test Account 2"); UpdateCalendarTest.AddAccount("Test Account 3"); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 1", "calendar1-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 2")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 3")); CDSGetCalendarInfo calendar1Info = UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test"); CDSGetCalendarInfo calendar2Info = UpdateCalendarTest.GetCalendar("Test Account 2", "calendar1-test"); CDSGetCalendarInfo calendar3Info = UpdateCalendarTest.GetCalendar("Test Account 3", "calendar1-test"); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar1Info.calendarID, "Calendar 1 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar2Info.calendarID, "Calendar 1 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar3Info.calendarID, "Calendar 1 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar1Info.calendarID, "Calendar 1 Updated", DefaultColour, "Calendar Description 1 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar2Info.calendarID, "Calendar 1 Updated", DefaultColour, "Calendar Description 2 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar3Info.calendarID, "Calendar 1 Updated", DefaultColour, "Calendar Description 3 Updated")); ASSERT_EQ("Calendar 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test").calendarName); ASSERT_EQ("Calendar 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 2", "calendar1-test").calendarName); ASSERT_EQ("Calendar 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 3", "calendar1-test").calendarName); + ASSERT_EQ("Calendar Description 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test").calendarDescription); + ASSERT_EQ("Calendar Description 2 Updated", UpdateCalendarTest.GetCalendar("Test Account 2", "calendar1-test").calendarDescription); + ASSERT_EQ("Calendar Description 3 Updated", UpdateCalendarTest.GetCalendar("Test Account 3", "calendar1-test").calendarDescription); + } TEST(CalendarDataStorage, Update_Two_Calendars_With_One_Account){ @@ -747,17 +778,20 @@ TEST(CalendarDataStorage, Update_Two_Calendars_With_One_Account){ UpdateCalendarTest.AddAccount("Test Account 1"); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description 2")); CDSGetCalendarInfo calendar1Info = UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test"); CDSGetCalendarInfo calendar2Info = UpdateCalendarTest.GetCalendar("Test Account 1", "calendar2-test"); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar1Info.calendarID, "Calendar 1 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar2Info.calendarID, "Calendar 2 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar1Info.calendarID, "Calendar 1 Updated", DefaultColour, "Calendar Description 1 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar2Info.calendarID, "Calendar 2 Updated", DefaultColour, "Calendar Description 2 Updated")); ASSERT_EQ("Calendar 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test").calendarName); ASSERT_EQ("Calendar 2 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar2-test").calendarName); + + ASSERT_EQ("Calendar Description 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test").calendarDescription); + ASSERT_EQ("Calendar Description 2 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar2-test").calendarDescription); } @@ -768,26 +802,31 @@ TEST(CalendarDataStorage, Update_Two_Calendars_With_Two_Accounts){ UpdateCalendarTest.AddAccount("Test Account 1"); UpdateCalendarTest.AddAccount("Test Account 2"); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 3", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 4", "calendar2-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description 2")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 3", "calendar1-test", DefaultColour, "Calendar Description 3")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 4", "calendar2-test", DefaultColour, "Calendar Description 4")); CDSGetCalendarInfo calendar1Info = UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test"); CDSGetCalendarInfo calendar2Info = UpdateCalendarTest.GetCalendar("Test Account 1", "calendar2-test"); CDSGetCalendarInfo calendar3Info = UpdateCalendarTest.GetCalendar("Test Account 2", "calendar1-test"); CDSGetCalendarInfo calendar4Info = UpdateCalendarTest.GetCalendar("Test Account 2", "calendar2-test"); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar1Info.calendarID, "Calendar 1 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar2Info.calendarID, "Calendar 2 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar3Info.calendarID, "Calendar 3 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar4Info.calendarID, "Calendar 4 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar1Info.calendarID, "Calendar 1 Updated", DefaultColour, "Calendar Description 1 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar2Info.calendarID, "Calendar 2 Updated", DefaultColour, "Calendar Description 2 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar3Info.calendarID, "Calendar 3 Updated", DefaultColour, "Calendar Description 3 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar4Info.calendarID, "Calendar 4 Updated", DefaultColour, "Calendar Description 4 Updated")); ASSERT_EQ("Calendar 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test").calendarName); ASSERT_EQ("Calendar 2 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar2-test").calendarName); ASSERT_EQ("Calendar 3 Updated", UpdateCalendarTest.GetCalendar("Test Account 2", "calendar1-test").calendarName); ASSERT_EQ("Calendar 4 Updated", UpdateCalendarTest.GetCalendar("Test Account 2", "calendar2-test").calendarName); + ASSERT_EQ("Calendar Description 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test").calendarDescription); + ASSERT_EQ("Calendar Description 2 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar2-test").calendarDescription); + ASSERT_EQ("Calendar Description 3 Updated", UpdateCalendarTest.GetCalendar("Test Account 2", "calendar1-test").calendarDescription); + ASSERT_EQ("Calendar Description 4 Updated", UpdateCalendarTest.GetCalendar("Test Account 2", "calendar2-test").calendarDescription); + } TEST(CalendarDataStorage, Update_Two_Calendars_With_Three_Accounts){ @@ -798,12 +837,12 @@ TEST(CalendarDataStorage, Update_Two_Calendars_With_Three_Accounts){ UpdateCalendarTest.AddAccount("Test Account 2"); UpdateCalendarTest.AddAccount("Test Account 3"); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 3", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 4", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 5", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 6", "calendar2-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description 2")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 3", "calendar1-test", DefaultColour, "Calendar Description 3")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 4", "calendar2-test", DefaultColour, "Calendar Description 4")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 5", "calendar1-test", DefaultColour, "Calendar Description 5")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 6", "calendar2-test", DefaultColour, "Calendar Description 6")); CDSGetCalendarInfo calendar1Info = UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test"); CDSGetCalendarInfo calendar2Info = UpdateCalendarTest.GetCalendar("Test Account 1", "calendar2-test"); @@ -812,12 +851,12 @@ TEST(CalendarDataStorage, Update_Two_Calendars_With_Three_Accounts){ CDSGetCalendarInfo calendar5Info = UpdateCalendarTest.GetCalendar("Test Account 3", "calendar1-test"); CDSGetCalendarInfo calendar6Info = UpdateCalendarTest.GetCalendar("Test Account 3", "calendar2-test"); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar1Info.calendarID, "Calendar 1 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar2Info.calendarID, "Calendar 2 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar3Info.calendarID, "Calendar 3 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar4Info.calendarID, "Calendar 4 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar5Info.calendarID, "Calendar 5 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar6Info.calendarID, "Calendar 6 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar1Info.calendarID, "Calendar 1 Updated", DefaultColour, "Calendar Description 1 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar2Info.calendarID, "Calendar 2 Updated", DefaultColour, "Calendar Description 2 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar3Info.calendarID, "Calendar 3 Updated", DefaultColour, "Calendar Description 3 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar4Info.calendarID, "Calendar 4 Updated", DefaultColour, "Calendar Description 4 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar5Info.calendarID, "Calendar 5 Updated", DefaultColour, "Calendar Description 5 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar6Info.calendarID, "Calendar 6 Updated", DefaultColour, "Calendar Description 6 Updated")); ASSERT_EQ("Calendar 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test").calendarName); ASSERT_EQ("Calendar 2 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar2-test").calendarName); @@ -826,6 +865,13 @@ TEST(CalendarDataStorage, Update_Two_Calendars_With_Three_Accounts){ ASSERT_EQ("Calendar 5 Updated", UpdateCalendarTest.GetCalendar("Test Account 3", "calendar1-test").calendarName); ASSERT_EQ("Calendar 6 Updated", UpdateCalendarTest.GetCalendar("Test Account 3", "calendar2-test").calendarName); + ASSERT_EQ("Calendar Description 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test").calendarDescription); + ASSERT_EQ("Calendar Description 2 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar2-test").calendarDescription); + ASSERT_EQ("Calendar Description 3 Updated", UpdateCalendarTest.GetCalendar("Test Account 2", "calendar1-test").calendarDescription); + ASSERT_EQ("Calendar Description 4 Updated", UpdateCalendarTest.GetCalendar("Test Account 2", "calendar2-test").calendarDescription); + ASSERT_EQ("Calendar Description 5 Updated", UpdateCalendarTest.GetCalendar("Test Account 3", "calendar1-test").calendarDescription); + ASSERT_EQ("Calendar Description 6 Updated", UpdateCalendarTest.GetCalendar("Test Account 3", "calendar2-test").calendarDescription); + } @@ -835,22 +881,26 @@ TEST(CalendarDataStorage, Update_Three_Calendars_With_One_Account){ UpdateCalendarTest.AddAccount("Test Account 1"); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description 2")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description 3")); CDSGetCalendarInfo calendar1Info = UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test"); CDSGetCalendarInfo calendar2Info = UpdateCalendarTest.GetCalendar("Test Account 1", "calendar2-test"); CDSGetCalendarInfo calendar3Info = UpdateCalendarTest.GetCalendar("Test Account 1", "calendar3-test"); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar1Info.calendarID, "Calendar 1 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar2Info.calendarID, "Calendar 2 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar3Info.calendarID, "Calendar 3 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar1Info.calendarID, "Calendar 1 Updated", DefaultColour, "Calendar Description 1 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar2Info.calendarID, "Calendar 2 Updated", DefaultColour, "Calendar Description 2 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar3Info.calendarID, "Calendar 3 Updated", DefaultColour, "Calendar Description 3 Updated")); ASSERT_EQ("Calendar 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test").calendarName); ASSERT_EQ("Calendar 2 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar2-test").calendarName); ASSERT_EQ("Calendar 3 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar3-test").calendarName); - + + ASSERT_EQ("Calendar Description 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test").calendarDescription); + ASSERT_EQ("Calendar Description 2 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar2-test").calendarDescription); + ASSERT_EQ("Calendar Description 3 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar3-test").calendarDescription); + } TEST(CalendarDataStorage, Update_Three_Calendars_With_Two_Accounts){ @@ -860,12 +910,12 @@ TEST(CalendarDataStorage, Update_Three_Calendars_With_Two_Accounts){ UpdateCalendarTest.AddAccount("Test Account 1"); UpdateCalendarTest.AddAccount("Test Account 2"); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 4", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 5", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 6", "calendar3-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description 2")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description 3")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 4", "calendar1-test", DefaultColour, "Calendar Description 4")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 5", "calendar2-test", DefaultColour, "Calendar Description 5")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 6", "calendar3-test", DefaultColour, "Calendar Description 6")); CDSGetCalendarInfo calendar1Info = UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test"); CDSGetCalendarInfo calendar2Info = UpdateCalendarTest.GetCalendar("Test Account 1", "calendar2-test"); @@ -874,12 +924,12 @@ TEST(CalendarDataStorage, Update_Three_Calendars_With_Two_Accounts){ CDSGetCalendarInfo calendar5Info = UpdateCalendarTest.GetCalendar("Test Account 2", "calendar2-test"); CDSGetCalendarInfo calendar6Info = UpdateCalendarTest.GetCalendar("Test Account 2", "calendar3-test"); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar1Info.calendarID, "Calendar 1 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar2Info.calendarID, "Calendar 2 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar3Info.calendarID, "Calendar 3 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar4Info.calendarID, "Calendar 4 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar5Info.calendarID, "Calendar 5 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar6Info.calendarID, "Calendar 6 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar1Info.calendarID, "Calendar 1 Updated", DefaultColour, "Calendar Description 1 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar2Info.calendarID, "Calendar 2 Updated", DefaultColour, "Calendar Description 2 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar3Info.calendarID, "Calendar 3 Updated", DefaultColour, "Calendar Description 3 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar4Info.calendarID, "Calendar 4 Updated", DefaultColour, "Calendar Description 4 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar5Info.calendarID, "Calendar 5 Updated", DefaultColour, "Calendar Description 5 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar6Info.calendarID, "Calendar 6 Updated", DefaultColour, "Calendar Description 6 Updated")); ASSERT_EQ("Calendar 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test").calendarName); ASSERT_EQ("Calendar 2 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar2-test").calendarName); @@ -888,6 +938,13 @@ TEST(CalendarDataStorage, Update_Three_Calendars_With_Two_Accounts){ ASSERT_EQ("Calendar 5 Updated", UpdateCalendarTest.GetCalendar("Test Account 2", "calendar2-test").calendarName); ASSERT_EQ("Calendar 6 Updated", UpdateCalendarTest.GetCalendar("Test Account 2", "calendar3-test").calendarName); + ASSERT_EQ("Calendar Description 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test").calendarDescription); + ASSERT_EQ("Calendar Description 2 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar2-test").calendarDescription); + ASSERT_EQ("Calendar Description 3 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar3-test").calendarDescription); + ASSERT_EQ("Calendar Description 4 Updated", UpdateCalendarTest.GetCalendar("Test Account 2", "calendar1-test").calendarDescription); + ASSERT_EQ("Calendar Description 5 Updated", UpdateCalendarTest.GetCalendar("Test Account 2", "calendar2-test").calendarDescription); + ASSERT_EQ("Calendar Description 6 Updated", UpdateCalendarTest.GetCalendar("Test Account 2", "calendar3-test").calendarDescription); + } TEST(CalendarDataStorage, Update_Three_Calendars_With_Three_Accounts){ @@ -898,15 +955,15 @@ TEST(CalendarDataStorage, Update_Three_Calendars_With_Three_Accounts){ UpdateCalendarTest.AddAccount("Test Account 2"); UpdateCalendarTest.AddAccount("Test Account 3"); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 4", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 5", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 6", "calendar3-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 7", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 8", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 9", "calendar3-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description 2")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description 3")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 4", "calendar1-test", DefaultColour, "Calendar Description 4")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 5", "calendar2-test", DefaultColour, "Calendar Description 5")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 2").accountID, "Calendar 6", "calendar3-test", DefaultColour, "Calendar Description 6")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 7", "calendar1-test", DefaultColour, "Calendar Description 7")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 8", "calendar2-test", DefaultColour, "Calendar Description 8")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 9", "calendar3-test", DefaultColour, "Calendar Description 9")); CDSGetCalendarInfo calendar1Info = UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test"); CDSGetCalendarInfo calendar2Info = UpdateCalendarTest.GetCalendar("Test Account 1", "calendar2-test"); @@ -918,15 +975,15 @@ TEST(CalendarDataStorage, Update_Three_Calendars_With_Three_Accounts){ CDSGetCalendarInfo calendar8Info = UpdateCalendarTest.GetCalendar("Test Account 3", "calendar2-test"); CDSGetCalendarInfo calendar9Info = UpdateCalendarTest.GetCalendar("Test Account 3", "calendar3-test"); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar1Info.calendarID, "Calendar 1 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar2Info.calendarID, "Calendar 2 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar3Info.calendarID, "Calendar 3 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar4Info.calendarID, "Calendar 4 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar5Info.calendarID, "Calendar 5 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar6Info.calendarID, "Calendar 6 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar7Info.calendarID, "Calendar 7 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar8Info.calendarID, "Calendar 8 Updated")); - ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar9Info.calendarID, "Calendar 9 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar1Info.calendarID, "Calendar 1 Updated", DefaultColour, "Calendar Description 1 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar2Info.calendarID, "Calendar 2 Updated", DefaultColour, "Calendar Description 2 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar3Info.calendarID, "Calendar 3 Updated", DefaultColour, "Calendar Description 3 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar4Info.calendarID, "Calendar 4 Updated", DefaultColour, "Calendar Description 4 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar5Info.calendarID, "Calendar 5 Updated", DefaultColour, "Calendar Description 5 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar6Info.calendarID, "Calendar 6 Updated", DefaultColour, "Calendar Description 6 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar7Info.calendarID, "Calendar 7 Updated", DefaultColour, "Calendar Description 7 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar8Info.calendarID, "Calendar 8 Updated", DefaultColour, "Calendar Description 8 Updated")); + ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.UpdateCalendar(calendar9Info.calendarID, "Calendar 9 Updated", DefaultColour, "Calendar Description 9 Updated")); ASSERT_EQ("Calendar 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test").calendarName); ASSERT_EQ("Calendar 2 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar2-test").calendarName); @@ -938,6 +995,16 @@ TEST(CalendarDataStorage, Update_Three_Calendars_With_Three_Accounts){ ASSERT_EQ("Calendar 8 Updated", UpdateCalendarTest.GetCalendar("Test Account 3", "calendar2-test").calendarName); ASSERT_EQ("Calendar 9 Updated", UpdateCalendarTest.GetCalendar("Test Account 3", "calendar3-test").calendarName); + ASSERT_EQ("Calendar Description 1 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test").calendarDescription); + ASSERT_EQ("Calendar Description 2 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar2-test").calendarDescription); + ASSERT_EQ("Calendar Description 3 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar3-test").calendarDescription); + ASSERT_EQ("Calendar Description 4 Updated", UpdateCalendarTest.GetCalendar("Test Account 2", "calendar1-test").calendarDescription); + ASSERT_EQ("Calendar Description 5 Updated", UpdateCalendarTest.GetCalendar("Test Account 2", "calendar2-test").calendarDescription); + ASSERT_EQ("Calendar Description 6 Updated", UpdateCalendarTest.GetCalendar("Test Account 2", "calendar3-test").calendarDescription); + ASSERT_EQ("Calendar Description 7 Updated", UpdateCalendarTest.GetCalendar("Test Account 3", "calendar1-test").calendarDescription); + ASSERT_EQ("Calendar Description 8 Updated", UpdateCalendarTest.GetCalendar("Test Account 3", "calendar2-test").calendarDescription); + ASSERT_EQ("Calendar Description 9 Updated", UpdateCalendarTest.GetCalendar("Test Account 3", "calendar3-test").calendarDescription); + } TEST(CalendarDataStorage, Delete_One_Calendar){ @@ -947,7 +1014,7 @@ TEST(CalendarDataStorage, Delete_One_Calendar){ DeleteCalendarTest.AddAccount("Test Account 1"); - ASSERT_EQ(CDSCALENDAR_OK, DeleteCalendarTest.AddCalendar(DeleteCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, DeleteCalendarTest.AddCalendar(DeleteCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1")); calendarID = DeleteCalendarTest.GetCalendar(DeleteCalendarTest.GetAccount("Test Account 1").accountName, "calendar1-test").calendarID; @@ -964,8 +1031,8 @@ TEST(CalendarDataStorage, Delete_Two_Calendars){ DeleteCalendarTest.AddAccount("Test Account 1"); DeleteCalendarTest.AddAccount("Test Account 2"); - ASSERT_EQ(CDSCALENDAR_OK, DeleteCalendarTest.AddCalendar(DeleteCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, DeleteCalendarTest.AddCalendar(DeleteCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, DeleteCalendarTest.AddCalendar(DeleteCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1")); + ASSERT_EQ(CDSCALENDAR_OK, DeleteCalendarTest.AddCalendar(DeleteCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description 1")); calendarID1 = DeleteCalendarTest.GetCalendar(DeleteCalendarTest.GetAccount("Test Account 1").accountName, "calendar1-test").calendarID; calendarID2 = DeleteCalendarTest.GetCalendar(DeleteCalendarTest.GetAccount("Test Account 1").accountName, "calendar2-test").calendarID; @@ -986,9 +1053,9 @@ TEST(CalendarDataStorage, Delete_Three_Calendars){ DeleteCalendarTest.AddAccount("Test Account 2"); DeleteCalendarTest.AddAccount("Test Account 3"); - ASSERT_EQ(CDSCALENDAR_OK, DeleteCalendarTest.AddCalendar(DeleteCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, DeleteCalendarTest.AddCalendar(DeleteCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour)); - ASSERT_EQ(CDSCALENDAR_OK, DeleteCalendarTest.AddCalendar(DeleteCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour)); + ASSERT_EQ(CDSCALENDAR_OK, DeleteCalendarTest.AddCalendar(DeleteCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1")); + ASSERT_EQ(CDSCALENDAR_OK, DeleteCalendarTest.AddCalendar(DeleteCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description 1")); + ASSERT_EQ(CDSCALENDAR_OK, DeleteCalendarTest.AddCalendar(DeleteCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description 1")); calendarID1 = DeleteCalendarTest.GetCalendar(DeleteCalendarTest.GetAccount("Test Account 1").accountName, "calendar1-test").calendarID; calendarID2 = DeleteCalendarTest.GetCalendar(DeleteCalendarTest.GetAccount("Test Account 1").accountName, "calendar2-test").calendarID; @@ -1005,7 +1072,7 @@ TEST(CalendarDataStorage, Add_One_Event){ CalendarDataStorage AddEventTest; AddEventTest.AddAccount("Test Account 1"); - AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); + AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEventResult = AddEventTest.AddEvent(1, "CalendarEvent1.ics"); @@ -1019,7 +1086,7 @@ TEST(CalendarDataStorage, Add_Two_Events){ CalendarDataStorage AddEventTest; AddEventTest.AddAccount("Test Account 1"); - AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); + AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEvent1Result = AddEventTest.AddEvent(1, "CalendarEvent1.ics"); @@ -1038,7 +1105,7 @@ TEST(CalendarDataStorage, Add_Three_Events){ CalendarDataStorage AddEventTest; AddEventTest.AddAccount("Test Account 1"); - AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); + AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEvent1Result = AddEventTest.AddEvent(1, "CalendarEvent1.ics"); @@ -1062,7 +1129,7 @@ TEST(CalendarDataStorage, Add_One_Event_And_Get_Event_Basic_Information){ CalendarDataStorage AddEventTest; AddEventTest.AddAccount("Test Account 1"); - AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); + AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEventResult = AddEventTest.AddEvent(1, "CalendarEvent1.ics"); // Get the entry information. @@ -1092,7 +1159,7 @@ TEST(CalendarDataStorage, Add_One_Event_And_Get_Event_Basic_Information_With_Dur CalendarDataStorage AddEventTest; AddEventTest.AddAccount("Test Account 1"); - AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); + AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEventResult = AddEventTest.AddEvent(1, "CalendarEvent2.ics"); EXPECT_EQ(CDSENTRY_OK, addEventResult.addEventResult); @@ -1129,7 +1196,7 @@ TEST(CalendarDataStorage, Add_Two_Events_And_Get_Event_Basic_Information){ CalendarDataStorage AddEventTest; AddEventTest.AddAccount("Test Account 1"); - AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); + AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEvent1Result = AddEventTest.AddEvent(1, "CalendarEvent1.ics"); CDSAddEntryResult addEvent2Result = AddEventTest.AddEvent(1, "CalendarEvent2.ics"); @@ -1185,7 +1252,7 @@ TEST(CalendarDataStorage, Add_The_Same_Three_Events_And_Get_Event_Information){ CalendarDataStorage AddEventTest; AddEventTest.AddAccount("Test Account 1"); - AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); + AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEvent1Result = AddEventTest.AddEvent(1, "CalendarEvent1.ics"); CDSAddEntryResult addEvent2Result = AddEventTest.AddEvent(1, "CalendarEvent1.ics"); CDSAddEntryResult addEvent3Result = AddEventTest.AddEvent(1, "CalendarEvent1.ics"); @@ -1256,7 +1323,7 @@ TEST(CalendarDataStorage, Add_Three_Events_And_Get_Event_Information){ CalendarDataStorage AddEventTest; AddEventTest.AddAccount("Test Account 1"); - AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); + AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEvent1Result = AddEventTest.AddEvent(1, "CalendarEvent1.ics"); CDSAddEntryResult addEvent2Result = AddEventTest.AddEvent(1, "CalendarEvent2.ics"); CDSAddEntryResult addEvent3Result = AddEventTest.AddEvent(1, "CalendarEvent3.ics"); @@ -1332,7 +1399,7 @@ TEST(CalendarDataStorage, Delete_One_Event){ CalendarDataStorage DeleteEventTest; DeleteEventTest.AddAccount("Test Account 1"); - DeleteEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); + DeleteEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEventResult = DeleteEventTest.AddEvent(1, "CalendarEvent1.ics"); EXPECT_EQ(CDSENTRY_OK, addEventResult.addEventResult); @@ -1346,7 +1413,7 @@ TEST(CalendarDataStorage, Delete_Two_Events){ CalendarDataStorage DeleteEventTest; DeleteEventTest.AddAccount("Test Account 1"); - DeleteEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); + DeleteEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEvent1Result = DeleteEventTest.AddEvent(1, "CalendarEvent1.ics"); CDSAddEntryResult addEvent2Result = DeleteEventTest.AddEvent(1, "CalendarEvent2.ics"); @@ -1363,7 +1430,7 @@ TEST(CalendarDataStorage, Delete_Three_Events){ CalendarDataStorage DeleteEventTest; DeleteEventTest.AddAccount("Test Account 1"); - DeleteEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); + DeleteEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEvent1Result = DeleteEventTest.AddEvent(1, "CalendarEvent1.ics"); CDSAddEntryResult addEvent2Result = DeleteEventTest.AddEvent(1, "CalendarEvent2.ics"); CDSAddEntryResult addEvent3Result = DeleteEventTest.AddEvent(1, "CalendarEvent3.ics"); @@ -1383,7 +1450,7 @@ TEST(CalendarDataStorage, Delete_One_Calendar_And_Events){ CalendarDataStorage DeleteEventTest; DeleteEventTest.AddAccount("Test Account 1"); - DeleteEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); + DeleteEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEvent1Result = DeleteEventTest.AddEvent(1, "CalendarEvent1.ics"); CDSAddEntryResult addEvent2Result = DeleteEventTest.AddEvent(1, "CalendarEvent2.ics"); CDSAddEntryResult addEvent3Result = DeleteEventTest.AddEvent(1, "CalendarEvent3.ics"); @@ -1401,8 +1468,8 @@ TEST(CalendarDataStorage, Delete_Two_Calendars_And_Events){ CalendarDataStorage DeleteEventTest; DeleteEventTest.AddAccount("Test Account 1"); - DeleteEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); - DeleteEventTest.AddCalendar(1, "Calendar 1", "calendar2-test", DefaultColour); + DeleteEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); + DeleteEventTest.AddCalendar(1, "Calendar 1", "calendar2-test", DefaultColour, "Calendar Description 1"); // Setup and delete the first calendar. @@ -1435,9 +1502,9 @@ TEST(CalendarDataStorage, Delete_Three_Calendars_And_Events){ CalendarDataStorage DeleteEventTest; DeleteEventTest.AddAccount("Test Account 1"); - DeleteEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); - DeleteEventTest.AddCalendar(1, "Calendar 2", "calendar2-test", DefaultColour); - DeleteEventTest.AddCalendar(1, "Calendar 3", "calendar3-test", DefaultColour); + DeleteEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); + DeleteEventTest.AddCalendar(1, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description 1"); + DeleteEventTest.AddCalendar(1, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description 1"); // Setup and delete the first calendar. @@ -1482,7 +1549,7 @@ TEST(CalendarDataStorage, Delete_One_Account_And_Associated_Data){ CalendarDataStorage DeleteAccountTest; DeleteAccountTest.AddAccount("Test Account 1"); - DeleteAccountTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); + DeleteAccountTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); // Setup and delete the first account. @@ -1510,9 +1577,9 @@ TEST(CalendarDataStorage, Delete_Two_Accounts_And_Associated_Data){ // Setup and delete the first account. - DeleteAccountTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); - DeleteAccountTest.AddCalendar(1, "Calendar 2", "calendar1-test", DefaultColour); - DeleteAccountTest.AddCalendar(1, "Calendar 3", "calendar1-test", DefaultColour); + DeleteAccountTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); + DeleteAccountTest.AddCalendar(1, "Calendar 2", "calendar1-test", DefaultColour, "Calendar Description 1"); + DeleteAccountTest.AddCalendar(1, "Calendar 3", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEvent1Result = DeleteAccountTest.AddEvent(1, "CalendarEvent1.ics"); CDSAddEntryResult addEvent2Result = DeleteAccountTest.AddEvent(1, "CalendarEvent2.ics"); @@ -1528,9 +1595,9 @@ TEST(CalendarDataStorage, Delete_Two_Accounts_And_Associated_Data){ // Setup and delete the second account. - DeleteAccountTest.AddCalendar(2, "Calendar 1", "calendar1-test", DefaultColour); - DeleteAccountTest.AddCalendar(2, "Calendar 2", "calendar1-test", DefaultColour); - DeleteAccountTest.AddCalendar(2, "Calendar 3", "calendar1-test", DefaultColour); + DeleteAccountTest.AddCalendar(2, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); + DeleteAccountTest.AddCalendar(2, "Calendar 2", "calendar1-test", DefaultColour, "Calendar Description 1"); + DeleteAccountTest.AddCalendar(2, "Calendar 3", "calendar1-test", DefaultColour, "Calendar Description 1"); addEvent1Result = DeleteAccountTest.AddEvent(4, "CalendarEvent1.ics"); addEvent2Result = DeleteAccountTest.AddEvent(4, "CalendarEvent2.ics"); @@ -1556,9 +1623,9 @@ TEST(CalendarDataStorage, Delete_Three_Accounts_And_Associated_Data){ // Setup and delete the first account. - DeleteAccountTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); - DeleteAccountTest.AddCalendar(1, "Calendar 2", "calendar1-test", DefaultColour); - DeleteAccountTest.AddCalendar(1, "Calendar 3", "calendar1-test", DefaultColour); + DeleteAccountTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); + DeleteAccountTest.AddCalendar(1, "Calendar 2", "calendar1-test", DefaultColour, "Calendar Description 1"); + DeleteAccountTest.AddCalendar(1, "Calendar 3", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEvent1Result = DeleteAccountTest.AddEvent(1, "CalendarEvent1.ics"); CDSAddEntryResult addEvent2Result = DeleteAccountTest.AddEvent(1, "CalendarEvent2.ics"); @@ -1574,9 +1641,9 @@ TEST(CalendarDataStorage, Delete_Three_Accounts_And_Associated_Data){ // Setup and delete the second account. - DeleteAccountTest.AddCalendar(2, "Calendar 1", "calendar1-test", DefaultColour); - DeleteAccountTest.AddCalendar(2, "Calendar 2", "calendar1-test", DefaultColour); - DeleteAccountTest.AddCalendar(2, "Calendar 3", "calendar1-test", DefaultColour); + DeleteAccountTest.AddCalendar(2, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); + DeleteAccountTest.AddCalendar(2, "Calendar 2", "calendar1-test", DefaultColour, "Calendar Description 1"); + DeleteAccountTest.AddCalendar(2, "Calendar 3", "calendar1-test", DefaultColour, "Calendar Description 1"); addEvent1Result = DeleteAccountTest.AddEvent(4, "CalendarEvent1.ics"); addEvent2Result = DeleteAccountTest.AddEvent(4, "CalendarEvent2.ics"); @@ -1592,9 +1659,9 @@ TEST(CalendarDataStorage, Delete_Three_Accounts_And_Associated_Data){ // Setup and delete the third account. - DeleteAccountTest.AddCalendar(3, "Calendar 1", "calendar1-test", DefaultColour); - DeleteAccountTest.AddCalendar(3, "Calendar 2", "calendar1-test", DefaultColour); - DeleteAccountTest.AddCalendar(3, "Calendar 3", "calendar1-test", DefaultColour); + DeleteAccountTest.AddCalendar(3, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); + DeleteAccountTest.AddCalendar(3, "Calendar 2", "calendar1-test", DefaultColour, "Calendar Description 1"); + DeleteAccountTest.AddCalendar(3, "Calendar 3", "calendar1-test", DefaultColour, "Calendar Description 1"); addEvent1Result = DeleteAccountTest.AddEvent(7, "CalendarEvent1.ics"); addEvent2Result = DeleteAccountTest.AddEvent(7, "CalendarEvent2.ics"); @@ -1618,9 +1685,9 @@ TEST(CalendarDataStorage, Get_List_Of_Events_For_One_Account){ // Setup and delete the first account. - GetEventsListTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); - GetEventsListTest.AddCalendar(1, "Calendar 2", "calendar1-test", DefaultColour); - GetEventsListTest.AddCalendar(1, "Calendar 3", "calendar1-test", DefaultColour); + GetEventsListTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); + GetEventsListTest.AddCalendar(1, "Calendar 2", "calendar1-test", DefaultColour, "Calendar Description 1"); + GetEventsListTest.AddCalendar(1, "Calendar 3", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEvent1Result = GetEventsListTest.AddEvent(1, "CalendarEvent1.ics"); CDSAddEntryResult addEvent2Result = GetEventsListTest.AddEvent(1, "CalendarEvent2.ics"); @@ -1642,9 +1709,9 @@ TEST(CalendarDataStorage, Get_List_Of_Events_For_Two_Accounts){ // Setup and delete the first account. - GetEventsListTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); - GetEventsListTest.AddCalendar(1, "Calendar 2", "calendar1-test", DefaultColour); - GetEventsListTest.AddCalendar(1, "Calendar 3", "calendar1-test", DefaultColour); + GetEventsListTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); + GetEventsListTest.AddCalendar(1, "Calendar 2", "calendar1-test", DefaultColour, "Calendar Description 1"); + GetEventsListTest.AddCalendar(1, "Calendar 3", "calendar1-test", DefaultColour, "Calendar Description 1"); // Setup the first account. @@ -1680,9 +1747,9 @@ TEST(CalendarDataStorage, Get_List_Of_Events_For_Three_Accounts){ // Setup and delete the first account. - GetEventsListTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); - GetEventsListTest.AddCalendar(1, "Calendar 2", "calendar1-test", DefaultColour); - GetEventsListTest.AddCalendar(1, "Calendar 3", "calendar1-test", DefaultColour); + GetEventsListTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); + GetEventsListTest.AddCalendar(1, "Calendar 2", "calendar1-test", DefaultColour, "Calendar Description 1"); + GetEventsListTest.AddCalendar(1, "Calendar 3", "calendar1-test", DefaultColour, "Calendar Description 1"); // Setup the first account. @@ -1730,9 +1797,9 @@ TEST(CalendarDataStorage, Get_List_Of_Calendars_For_One_Account){ // Setup the first account. - GetEventsListTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); - GetEventsListTest.AddCalendar(1, "Calendar 2", "calendar2-test", DefaultColour); - GetEventsListTest.AddCalendar(1, "Calendar 3", "calendar3-test", DefaultColour); + GetEventsListTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); + GetEventsListTest.AddCalendar(1, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description 1"); + GetEventsListTest.AddCalendar(1, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description 1"); // Get the list of calendar IDs. @@ -1757,9 +1824,9 @@ TEST(CalendarDataStorage, Get_List_Of_Calendars_For_Two_Accounts){ // Setup the first account. - GetEventsListTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); - GetEventsListTest.AddCalendar(1, "Calendar 2", "calendar2-test", DefaultColour); - GetEventsListTest.AddCalendar(1, "Calendar 3", "calendar3-test", DefaultColour); + GetEventsListTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); + GetEventsListTest.AddCalendar(1, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description 1"); + GetEventsListTest.AddCalendar(1, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description 1"); // Get the list of calendar IDs. @@ -1775,9 +1842,9 @@ TEST(CalendarDataStorage, Get_List_Of_Calendars_For_Two_Accounts){ // Setup the second account. - GetEventsListTest.AddCalendar(2, "Calendar 4", "calendar4-test", DefaultColour); - GetEventsListTest.AddCalendar(2, "Calendar 5", "calendar5-test", DefaultColour); - GetEventsListTest.AddCalendar(2, "Calendar 6", "calendar6-test", DefaultColour); + GetEventsListTest.AddCalendar(2, "Calendar 4", "calendar4-test", DefaultColour, "Calendar Description 1"); + GetEventsListTest.AddCalendar(2, "Calendar 5", "calendar5-test", DefaultColour, "Calendar Description 1"); + GetEventsListTest.AddCalendar(2, "Calendar 6", "calendar6-test", DefaultColour, "Calendar Description 1"); calendarList = GetEventsListTest.GetCalendarList(2); @@ -1801,9 +1868,9 @@ TEST(CalendarDataStorage, Get_List_Of_Calendars_For_Three_Accounts){ // Setup the first account. - GetEventsListTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour); - GetEventsListTest.AddCalendar(1, "Calendar 2", "calendar2-test", DefaultColour); - GetEventsListTest.AddCalendar(1, "Calendar 3", "calendar3-test", DefaultColour); + GetEventsListTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); + GetEventsListTest.AddCalendar(1, "Calendar 2", "calendar2-test", DefaultColour, "Calendar Description 1"); + GetEventsListTest.AddCalendar(1, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description 1"); // Get the list of calendar IDs. @@ -1819,9 +1886,9 @@ TEST(CalendarDataStorage, Get_List_Of_Calendars_For_Three_Accounts){ // Setup the second account. - GetEventsListTest.AddCalendar(2, "Calendar 4", "calendar4-test", DefaultColour); - GetEventsListTest.AddCalendar(2, "Calendar 5", "calendar5-test", DefaultColour); - GetEventsListTest.AddCalendar(2, "Calendar 6", "calendar6-test", DefaultColour); + GetEventsListTest.AddCalendar(2, "Calendar 4", "calendar4-test", DefaultColour, "Calendar Description 1"); + GetEventsListTest.AddCalendar(2, "Calendar 5", "calendar5-test", DefaultColour, "Calendar Description 1"); + GetEventsListTest.AddCalendar(2, "Calendar 6", "calendar6-test", DefaultColour, "Calendar Description 1"); calendarList = GetEventsListTest.GetCalendarList(2); @@ -1835,9 +1902,9 @@ TEST(CalendarDataStorage, Get_List_Of_Calendars_For_Three_Accounts){ // Setup the third account. - GetEventsListTest.AddCalendar(3, "Calendar 7", "calendar7-test", DefaultColour); - GetEventsListTest.AddCalendar(3, "Calendar 8", "calendar8-test", DefaultColour); - GetEventsListTest.AddCalendar(3, "Calendar 9", "calendar9-test", DefaultColour); + GetEventsListTest.AddCalendar(3, "Calendar 7", "calendar7-test", DefaultColour, "Calendar Description 1"); + GetEventsListTest.AddCalendar(3, "Calendar 8", "calendar8-test", DefaultColour, "Calendar Description 1"); + GetEventsListTest.AddCalendar(3, "Calendar 9", "calendar9-test", DefaultColour, "Calendar Description 1"); calendarList = GetEventsListTest.GetCalendarList(3); @@ -1849,4 +1916,212 @@ TEST(CalendarDataStorage, Get_List_Of_Calendars_For_Three_Accounts){ EXPECT_EQ("calendar8-test", calendarList.calendarListTextID.at(1)); EXPECT_EQ("calendar9-test", calendarList.calendarListTextID.at(2)); +} + +TEST(CalendarDataStorage, Add_One_Checksum){ + + CalendarDataStorage ChecksumTest; + + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("firstChecksum", "checksumYay")); + + // Get the checksum. + + //EXPECT_EQ("checksumYay", ChecksumTest.GetChecksum("firstChecksum")); + +} + +TEST(CalendarDataStorage, Add_Two_Checksus){ + + CalendarDataStorage ChecksumTest; + + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("firstChecksum", "checksumYay")); + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("secondChecksum", "checksumTwo")); + +} + +TEST(CalendarDataStorage, Add_Three_Checksus){ + + CalendarDataStorage ChecksumTest; + + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("firstChecksum", "checksumYay")); + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("secondChecksum", "checksumTwo")); + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("thirdChecksum", "checksumThree")); + +} + +TEST(CalendarDataStorage, Add_One_Checksum_And_Get_One_Checksum){ + + CalendarDataStorage ChecksumTest; + + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("firstChecksum", "checksumYay")); + + // Get the checksum. + + CDSGetChecksumResult getChecksumResult = ChecksumTest.GetChecksum("firstChecksum"); + + EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult); + EXPECT_EQ("checksumYay", getChecksumResult.checksumValue); + +} + +TEST(CalendarDataStorage, Add_Two_Checksums_And_Get_Two_Checksums){ + + CalendarDataStorage ChecksumTest; + + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("firstChecksum", "checksumYay")); + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("secondChecksum", "checksumTwo")); + + // Get the checksums. + + CDSGetChecksumResult getChecksumResult = ChecksumTest.GetChecksum("firstChecksum"); + + EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult); + EXPECT_EQ("checksumYay", getChecksumResult.checksumValue); + + getChecksumResult = ChecksumTest.GetChecksum("secondChecksum"); + + EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult); + EXPECT_EQ("checksumTwo", getChecksumResult.checksumValue); + +} + +TEST(CalendarDataStorage, Add_Three_Checksums_And_Get_Three_Checksums){ + + CalendarDataStorage ChecksumTest; + + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("firstChecksum", "checksumYay")); + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("secondChecksum", "checksumTwo")); + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("thirdChecksum", "checksumThree")); + + // Get the checksums. + + CDSGetChecksumResult getChecksumResult = ChecksumTest.GetChecksum("firstChecksum"); + + EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult); + EXPECT_EQ("checksumYay", getChecksumResult.checksumValue); + + getChecksumResult = ChecksumTest.GetChecksum("secondChecksum"); + + EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult); + EXPECT_EQ("checksumTwo", getChecksumResult.checksumValue); + + getChecksumResult = ChecksumTest.GetChecksum("thirdChecksum"); + + EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult); + EXPECT_EQ("checksumThree", getChecksumResult.checksumValue); + +} + +TEST(CalendarDataStorage, Add_One_Checksum_Update_One_Checksum_And_Get_One_Checksum){ + + CalendarDataStorage ChecksumTest; + + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("firstChecksum", "checksumYay")); + + // Get the checksum. + + CDSGetChecksumResult getChecksumResult = ChecksumTest.GetChecksum("firstChecksum"); + + EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult); + EXPECT_EQ("checksumYay", getChecksumResult.checksumValue); + + // Update the checksum. + + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.UpdateChecksum("firstChecksum", "updatedChecksum1")); + + // Get the checksum again. + + getChecksumResult = ChecksumTest.GetChecksum("firstChecksum"); + + EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult); + EXPECT_EQ("updatedChecksum1", getChecksumResult.checksumValue); + +} + +TEST(CalendarDataStorage, Add_Two_Checksums_Update_Two_Checksums_And_Get_Two_Checksums){ + + CalendarDataStorage ChecksumTest; + + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("firstChecksum", "checksumYay")); + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("secondChecksum", "checksumTwo")); + + // Get the checksum. + + CDSGetChecksumResult getChecksumResult = ChecksumTest.GetChecksum("firstChecksum"); + + EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult); + EXPECT_EQ("checksumYay", getChecksumResult.checksumValue); + + getChecksumResult = ChecksumTest.GetChecksum("secondChecksum"); + + EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult); + EXPECT_EQ("checksumTwo", getChecksumResult.checksumValue); + + // Update the checksum. + + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.UpdateChecksum("firstChecksum", "updatedChecksum1")); + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.UpdateChecksum("secondChecksum", "updatedChecksum2")); + + // Get the checksum again. + + getChecksumResult = ChecksumTest.GetChecksum("firstChecksum"); + + EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult); + EXPECT_EQ("updatedChecksum1", getChecksumResult.checksumValue); + + getChecksumResult = ChecksumTest.GetChecksum("secondChecksum"); + + EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult); + EXPECT_EQ("updatedChecksum2", getChecksumResult.checksumValue); + +} + +TEST(CalendarDataStorage, Add_Three_Checksums_Update_Three_Checksums_And_Get_Three_Checksums){ + + CalendarDataStorage ChecksumTest; + + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("firstChecksum", "checksumYay")); + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("secondChecksum", "checksumTwo")); + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("thirdChecksum", "checksumThree")); + + // Get the checksum. + + CDSGetChecksumResult getChecksumResult = ChecksumTest.GetChecksum("firstChecksum"); + + EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult); + EXPECT_EQ("checksumYay", getChecksumResult.checksumValue); + + getChecksumResult = ChecksumTest.GetChecksum("secondChecksum"); + + EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult); + EXPECT_EQ("checksumTwo", getChecksumResult.checksumValue); + + getChecksumResult = ChecksumTest.GetChecksum("thirdChecksum"); + + EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult); + EXPECT_EQ("checksumThree", getChecksumResult.checksumValue); + + // Update the checksum. + + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.UpdateChecksum("firstChecksum", "updatedChecksum1")); + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.UpdateChecksum("secondChecksum", "updatedChecksum2")); + EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.UpdateChecksum("thirdChecksum", "updatedChecksum3")); + + // Get the checksum again. + + getChecksumResult = ChecksumTest.GetChecksum("firstChecksum"); + + EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult); + EXPECT_EQ("updatedChecksum1", getChecksumResult.checksumValue); + + getChecksumResult = ChecksumTest.GetChecksum("secondChecksum"); + + EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult); + EXPECT_EQ("updatedChecksum2", getChecksumResult.checksumValue); + + getChecksumResult = ChecksumTest.GetChecksum("thirdChecksum"); + + EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult); + EXPECT_EQ("updatedChecksum3", getChecksumResult.checksumValue); + } \ No newline at end of file