From 4d0316bf5312ee073aef9f2199f43b70aa147e7a Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 11 Jan 2017 19:37:29 +0000 Subject: [PATCH] Unit Testing: Added extra parameter to AddAccount to CDS tests --- .../xestiacalendar_calendardatastorage.h | 227 +++++++++--------- 1 file changed, 119 insertions(+), 108 deletions(-) diff --git a/source/tests/xestiacalendar_calendardatastorage.h b/source/tests/xestiacalendar_calendardatastorage.h index ee0a234..a71151e 100644 --- a/source/tests/xestiacalendar_calendardatastorage.h +++ b/source/tests/xestiacalendar_calendardatastorage.h @@ -32,7 +32,7 @@ TEST(CalendarDataStorage, Add_One_Account){ CalendarDataStorage AddOneEntryTest; - ASSERT_EQ(CDSACCOUNT_OK, AddOneEntryTest.AddAccount("Test Account 1")); + ASSERT_EQ(CDSACCOUNT_OK, AddOneEntryTest.AddAccount("Test Account 1", 1)); } @@ -40,8 +40,8 @@ TEST(CalendarDataStorage, Add_Two_Accounts){ CalendarDataStorage AddTwoEntryTest; - ASSERT_EQ(CDSACCOUNT_OK, AddTwoEntryTest.AddAccount("Test Account 1")); - ASSERT_EQ(CDSACCOUNT_OK, AddTwoEntryTest.AddAccount("Test Account 2")); + ASSERT_EQ(CDSACCOUNT_OK, AddTwoEntryTest.AddAccount("Test Account 1", 1)); + ASSERT_EQ(CDSACCOUNT_OK, AddTwoEntryTest.AddAccount("Test Account 2", 2)); } @@ -49,9 +49,9 @@ TEST(CalendarDataStorage, Add_Three_Accounts){ CalendarDataStorage AddThreeEntryTest; - ASSERT_EQ(CDSACCOUNT_OK, AddThreeEntryTest.AddAccount("Test Account 1")); - ASSERT_EQ(CDSACCOUNT_OK, AddThreeEntryTest.AddAccount("Test Account 2")); - ASSERT_EQ(CDSACCOUNT_OK, AddThreeEntryTest.AddAccount("Test Account 3")); + ASSERT_EQ(CDSACCOUNT_OK, AddThreeEntryTest.AddAccount("Test Account 1", 1)); + ASSERT_EQ(CDSACCOUNT_OK, AddThreeEntryTest.AddAccount("Test Account 2", 2)); + ASSERT_EQ(CDSACCOUNT_OK, AddThreeEntryTest.AddAccount("Test Account 3", 3)); } @@ -59,7 +59,7 @@ TEST(CalendarDataStorage, Get_Account_Information){ CalendarDataStorage AccountInformationTest; - AccountInformationTest.AddAccount("Test Account 1"); + AccountInformationTest.AddAccount("Test Account 1", 1); ASSERT_EQ(CDSACCOUNT_OK, AccountInformationTest.GetAccount("Test Account 1").accountInfoResult); ASSERT_EQ("Test Account 1", AccountInformationTest.GetAccount("Test Account 1").accountName); ASSERT_EQ(1, AccountInformationTest.GetAccount("Test Account 1").accountID); @@ -70,16 +70,18 @@ TEST(CalendarDataStorage, Get_Two_Accounts_Information){ CalendarDataStorage AccountInformationTest; - AccountInformationTest.AddAccount("Test Account 1"); - AccountInformationTest.AddAccount("Test Account 2"); + AccountInformationTest.AddAccount("Test Account 1", 1); + AccountInformationTest.AddAccount("Test Account 2", 2); ASSERT_EQ(CDSACCOUNT_OK, AccountInformationTest.GetAccount("Test Account 1").accountInfoResult); ASSERT_EQ("Test Account 1", AccountInformationTest.GetAccount("Test Account 1").accountName); ASSERT_EQ(1, AccountInformationTest.GetAccount("Test Account 1").accountID); + ASSERT_EQ(1, AccountInformationTest.GetAccount("Test Account 1").accountPreferencesID); ASSERT_EQ(CDSACCOUNT_OK, AccountInformationTest.GetAccount("Test Account 2").accountInfoResult); ASSERT_EQ("Test Account 2", AccountInformationTest.GetAccount("Test Account 2").accountName); ASSERT_EQ(2, AccountInformationTest.GetAccount("Test Account 2").accountID); + ASSERT_EQ(2, AccountInformationTest.GetAccount("Test Account 2").accountPreferencesID); } @@ -87,21 +89,24 @@ TEST(CalendarDataStorage, Get_Three_Accounts_Information){ CalendarDataStorage AccountInformationTest; - AccountInformationTest.AddAccount("Test Account 1"); - AccountInformationTest.AddAccount("Test Account 2"); - AccountInformationTest.AddAccount("Test Account 3"); + AccountInformationTest.AddAccount("Test Account 1", 1); + AccountInformationTest.AddAccount("Test Account 2", 2); + AccountInformationTest.AddAccount("Test Account 3", 3); ASSERT_EQ(CDSACCOUNT_OK, AccountInformationTest.GetAccount("Test Account 1").accountInfoResult); ASSERT_EQ("Test Account 1", AccountInformationTest.GetAccount("Test Account 1").accountName); ASSERT_EQ(1, AccountInformationTest.GetAccount("Test Account 1").accountID); + ASSERT_EQ(1, AccountInformationTest.GetAccount("Test Account 1").accountPreferencesID); ASSERT_EQ(CDSACCOUNT_OK, AccountInformationTest.GetAccount("Test Account 2").accountInfoResult); ASSERT_EQ("Test Account 2", AccountInformationTest.GetAccount("Test Account 2").accountName); ASSERT_EQ(2, AccountInformationTest.GetAccount("Test Account 2").accountID); + ASSERT_EQ(2, AccountInformationTest.GetAccount("Test Account 2").accountPreferencesID); ASSERT_EQ(CDSACCOUNT_OK, AccountInformationTest.GetAccount("Test Account 3").accountInfoResult); ASSERT_EQ("Test Account 3", AccountInformationTest.GetAccount("Test Account 3").accountName); ASSERT_EQ(3, AccountInformationTest.GetAccount("Test Account 3").accountID); + ASSERT_EQ(3, AccountInformationTest.GetAccount("Test Account 3").accountPreferencesID); } @@ -109,7 +114,7 @@ TEST(CalendarDataStorage, Get_List_Of_One_Account){ CalendarDataStorage AccountInformationTest; - AccountInformationTest.AddAccount("Test Account 1"); + AccountInformationTest.AddAccount("Test Account 1", 1); CDSAccountList accountListData = AccountInformationTest.GetAccountList(); @@ -119,6 +124,7 @@ TEST(CalendarDataStorage, Get_List_Of_One_Account){ ASSERT_EQ(1, accountListData.accountList[0].accountID); ASSERT_EQ(CDSACCOUNT_OK, accountListData.accountList[0].accountInfoResult); ASSERT_EQ("Test Account 1", accountListData.accountList[0].accountName); + ASSERT_EQ(1, accountListData.accountList[0].accountPreferencesID); } @@ -126,8 +132,8 @@ TEST(CalendarDataStorage, Get_List_Of_Two_Accounts){ CalendarDataStorage AccountInformationTest; - AccountInformationTest.AddAccount("Test Account 1"); - AccountInformationTest.AddAccount("Test Account 2"); + AccountInformationTest.AddAccount("Test Account 1", 1); + AccountInformationTest.AddAccount("Test Account 2", 2); CDSAccountList accountListData = AccountInformationTest.GetAccountList(); @@ -137,10 +143,12 @@ TEST(CalendarDataStorage, Get_List_Of_Two_Accounts){ ASSERT_EQ(1, accountListData.accountList[0].accountID); ASSERT_EQ(CDSACCOUNT_OK, accountListData.accountList[0].accountInfoResult); ASSERT_EQ("Test Account 1", accountListData.accountList[0].accountName); + ASSERT_EQ(1, accountListData.accountList[0].accountPreferencesID); ASSERT_EQ(2, accountListData.accountList[1].accountID); ASSERT_EQ(CDSACCOUNT_OK, accountListData.accountList[1].accountInfoResult); ASSERT_EQ("Test Account 2", accountListData.accountList[1].accountName); + ASSERT_EQ(2, accountListData.accountList[1].accountPreferencesID); } @@ -148,9 +156,9 @@ TEST(CalendarDataStorage, Get_List_Of_Three_Accounts){ CalendarDataStorage AccountInformationTest; - AccountInformationTest.AddAccount("Test Account 1"); - AccountInformationTest.AddAccount("Test Account 2"); - AccountInformationTest.AddAccount("Test Account 3"); + AccountInformationTest.AddAccount("Test Account 1", 1); + AccountInformationTest.AddAccount("Test Account 2", 2); + AccountInformationTest.AddAccount("Test Account 3", 3); CDSAccountList accountListData = AccountInformationTest.GetAccountList(); @@ -160,14 +168,17 @@ TEST(CalendarDataStorage, Get_List_Of_Three_Accounts){ ASSERT_EQ(1, accountListData.accountList[0].accountID); ASSERT_EQ(CDSACCOUNT_OK, accountListData.accountList[0].accountInfoResult); ASSERT_EQ("Test Account 1", accountListData.accountList[0].accountName); + ASSERT_EQ(1, accountListData.accountList[0].accountPreferencesID); ASSERT_EQ(2, accountListData.accountList[1].accountID); ASSERT_EQ(CDSACCOUNT_OK, accountListData.accountList[1].accountInfoResult); ASSERT_EQ("Test Account 2", accountListData.accountList[1].accountName); + ASSERT_EQ(2, accountListData.accountList[1].accountPreferencesID); ASSERT_EQ(3, accountListData.accountList[2].accountID); ASSERT_EQ(CDSACCOUNT_OK, accountListData.accountList[2].accountInfoResult); ASSERT_EQ("Test Account 3", accountListData.accountList[2].accountName); + ASSERT_EQ(3, accountListData.accountList[2].accountPreferencesID); } @@ -175,7 +186,7 @@ TEST(CalendarDataStorage, Update_One_Account){ CalendarDataStorage UpdateAccountTest; - UpdateAccountTest.AddAccount("Test Account 1"); + UpdateAccountTest.AddAccount("Test Account 1", 1); int testAccount1ID = UpdateAccountTest.GetAccount("Test Account 1").accountID; @@ -190,8 +201,8 @@ TEST(CalendarDataStorage, Update_Two_Accounts){ CalendarDataStorage UpdateAccountTest; - UpdateAccountTest.AddAccount("Test Account 1"); - UpdateAccountTest.AddAccount("Test Account 2"); + UpdateAccountTest.AddAccount("Test Account 1", 1); + UpdateAccountTest.AddAccount("Test Account 2", 2); int testAccount1ID = UpdateAccountTest.GetAccount("Test Account 1").accountID; int testAccount2ID = UpdateAccountTest.GetAccount("Test Account 2").accountID; @@ -214,9 +225,9 @@ TEST(CalendarDataStorage, Update_Three_Accounts){ CalendarDataStorage UpdateAccountTest; - UpdateAccountTest.AddAccount("Test Account 1"); - UpdateAccountTest.AddAccount("Test Account 2"); - UpdateAccountTest.AddAccount("Test Account 3"); + UpdateAccountTest.AddAccount("Test Account 1", 1); + UpdateAccountTest.AddAccount("Test Account 2", 2); + UpdateAccountTest.AddAccount("Test Account 3", 3); int testAccount1ID = UpdateAccountTest.GetAccount("Test Account 1").accountID; int testAccount2ID = UpdateAccountTest.GetAccount("Test Account 2").accountID; @@ -245,7 +256,7 @@ TEST(CalendarDataStorage, Delete_One_Account){ CalendarDataStorage DeleteAccountTest; - DeleteAccountTest.AddAccount("Test Account 1"); + DeleteAccountTest.AddAccount("Test Account 1", 1); ASSERT_EQ(CDSACCOUNT_OK, DeleteAccountTest.DeleteAccount(DeleteAccountTest.GetAccount("Test Account 1").accountID)); @@ -255,8 +266,8 @@ TEST(CalendarDataStorage, Delete_Two_Accounts){ CalendarDataStorage DeleteAccountTest; - DeleteAccountTest.AddAccount("Test Account 1"); - DeleteAccountTest.AddAccount("Test Account 2"); + DeleteAccountTest.AddAccount("Test Account 1", 1); + DeleteAccountTest.AddAccount("Test Account 2", 2); ASSERT_EQ(CDSACCOUNT_OK, DeleteAccountTest.DeleteAccount(DeleteAccountTest.GetAccount("Test Account 1").accountID)); ASSERT_EQ(CDSACCOUNT_OK, DeleteAccountTest.DeleteAccount(DeleteAccountTest.GetAccount("Test Account 2").accountID)); @@ -267,9 +278,9 @@ TEST(CalendarDataStorage, Delete_Three_Accounts){ CalendarDataStorage DeleteAccountTest; - DeleteAccountTest.AddAccount("Test Account 1"); - DeleteAccountTest.AddAccount("Test Account 2"); - DeleteAccountTest.AddAccount("Test Account 3"); + DeleteAccountTest.AddAccount("Test Account 1", 1); + DeleteAccountTest.AddAccount("Test Account 2", 2); + DeleteAccountTest.AddAccount("Test Account 3", 3); ASSERT_EQ(CDSACCOUNT_OK, DeleteAccountTest.DeleteAccount(DeleteAccountTest.GetAccount("Test Account 1").accountID)); ASSERT_EQ(CDSACCOUNT_OK, DeleteAccountTest.DeleteAccount(DeleteAccountTest.GetAccount("Test Account 2").accountID)); @@ -281,7 +292,7 @@ TEST(CalendarDataStorage, Add_One_Calendar_To_One_Account){ CalendarDataStorage AddCalendarTest; - AddCalendarTest.AddAccount("Test Account 1"); + AddCalendarTest.AddAccount("Test Account 1", 1); ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); @@ -291,7 +302,7 @@ TEST(CalendarDataStorage, Add_Two_Calendars_To_One_Account){ CalendarDataStorage AddCalendarTest; - AddCalendarTest.AddAccount("Test Account 1"); + AddCalendarTest.AddAccount("Test Account 1", 1); 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")); @@ -302,7 +313,7 @@ TEST(CalendarDataStorage, Add_Three_Calendars_To_One_Account){ CalendarDataStorage AddCalendarTest; - AddCalendarTest.AddAccount("Test Account 1"); + AddCalendarTest.AddAccount("Test Account 1", 1); 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")); @@ -314,8 +325,8 @@ TEST(CalendarDataStorage, Add_One_Calendar_To_Two_Accounts){ CalendarDataStorage AddCalendarTest; - AddCalendarTest.AddAccount("Test Account 1"); - AddCalendarTest.AddAccount("Test Account 2"); + AddCalendarTest.AddAccount("Test Account 1", 1); + AddCalendarTest.AddAccount("Test Account 2", 2); ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); @@ -327,8 +338,8 @@ TEST(CalendarDataStorage, Add_Two_Calendars_To_Two_Accounts){ CalendarDataStorage AddCalendarTest; - AddCalendarTest.AddAccount("Test Account 1"); - AddCalendarTest.AddAccount("Test Account 2"); + AddCalendarTest.AddAccount("Test Account 1", 1); + AddCalendarTest.AddAccount("Test Account 2", 2); 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")); @@ -342,8 +353,8 @@ TEST(CalendarDataStorage, Add_Three_Calendars_To_Two_Accounts){ CalendarDataStorage AddCalendarTest; - AddCalendarTest.AddAccount("Test Account 1"); - AddCalendarTest.AddAccount("Test Account 2"); + AddCalendarTest.AddAccount("Test Account 1", 1); + AddCalendarTest.AddAccount("Test Account 2", 2); 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")); @@ -359,9 +370,9 @@ TEST(CalendarDataStorage, Add_One_Calendar_To_Three_Accounts){ CalendarDataStorage AddCalendarTest; - AddCalendarTest.AddAccount("Test Account 1"); - AddCalendarTest.AddAccount("Test Account 2"); - AddCalendarTest.AddAccount("Test Account 3"); + AddCalendarTest.AddAccount("Test Account 1", 1); + AddCalendarTest.AddAccount("Test Account 2", 2); + AddCalendarTest.AddAccount("Test Account 3", 3); ASSERT_EQ(CDSCALENDAR_OK, AddCalendarTest.AddCalendar(AddCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description")); @@ -375,9 +386,9 @@ TEST(CalendarDataStorage, Add_Two_Calendars_To_Three_Accounts){ CalendarDataStorage AddCalendarTest; - AddCalendarTest.AddAccount("Test Account 1"); - AddCalendarTest.AddAccount("Test Account 2"); - AddCalendarTest.AddAccount("Test Account 3"); + AddCalendarTest.AddAccount("Test Account 1", 1); + AddCalendarTest.AddAccount("Test Account 2", 2); + AddCalendarTest.AddAccount("Test Account 3", 3); 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")); @@ -394,9 +405,9 @@ TEST(CalendarDataStorage, Add_Three_Calendars_To_Three_Accounts){ CalendarDataStorage AddCalendarTest; - AddCalendarTest.AddAccount("Test Account 1"); - AddCalendarTest.AddAccount("Test Account 2"); - AddCalendarTest.AddAccount("Test Account 3"); + AddCalendarTest.AddAccount("Test Account 1", 1); + AddCalendarTest.AddAccount("Test Account 2", 2); + AddCalendarTest.AddAccount("Test Account 3", 3); 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")); @@ -416,7 +427,7 @@ TEST(CalendarDataStorage, Get_Calendar_Information_From_One_Account){ CalendarDataStorage GetCalendarTest; - GetCalendarTest.AddAccount("Test Account 1"); + GetCalendarTest.AddAccount("Test Account 1", 1); 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")); @@ -468,8 +479,8 @@ TEST(CalendarDataStorage, Get_Calendar_Information_From_Two_Accounts){ CalendarDataStorage GetCalendarTest; - GetCalendarTest.AddAccount("Test Account 1"); - GetCalendarTest.AddAccount("Test Account 2"); + GetCalendarTest.AddAccount("Test Account 1", 1); + GetCalendarTest.AddAccount("Test Account 2", 2); 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")); @@ -564,9 +575,9 @@ TEST(CalendarDataStorage, Get_Calendar_Information_From_Three_Accounts){ CalendarDataStorage GetCalendarTest; - GetCalendarTest.AddAccount("Test Account 1"); - GetCalendarTest.AddAccount("Test Account 2"); - GetCalendarTest.AddAccount("Test Account 3"); + GetCalendarTest.AddAccount("Test Account 1", 1); + GetCalendarTest.AddAccount("Test Account 2", 2); + GetCalendarTest.AddAccount("Test Account 3", 3); 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")); @@ -706,7 +717,7 @@ TEST(CalendarDataStorage, Update_One_Calendar_With_One_Account){ CalendarDataStorage UpdateCalendarTest; - UpdateCalendarTest.AddAccount("Test Account 1"); + UpdateCalendarTest.AddAccount("Test Account 1", 1); ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1")); @@ -722,8 +733,8 @@ TEST(CalendarDataStorage, Update_One_Calendar_With_Two_Accounts){ CalendarDataStorage UpdateCalendarTest; - UpdateCalendarTest.AddAccount("Test Account 1"); - UpdateCalendarTest.AddAccount("Test Account 2"); + UpdateCalendarTest.AddAccount("Test Account 1", 1); + UpdateCalendarTest.AddAccount("Test Account 2", 2); 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")); @@ -746,9 +757,9 @@ TEST(CalendarDataStorage, Update_One_Calendar_With_Three_Accounts){ CalendarDataStorage UpdateCalendarTest; - UpdateCalendarTest.AddAccount("Test Account 1"); - UpdateCalendarTest.AddAccount("Test Account 2"); - UpdateCalendarTest.AddAccount("Test Account 3"); + UpdateCalendarTest.AddAccount("Test Account 1", 1); + UpdateCalendarTest.AddAccount("Test Account 2", 2); + UpdateCalendarTest.AddAccount("Test Account 3", 3); 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")); @@ -776,7 +787,7 @@ TEST(CalendarDataStorage, Update_Two_Calendars_With_One_Account){ CalendarDataStorage UpdateCalendarTest; - UpdateCalendarTest.AddAccount("Test Account 1"); + UpdateCalendarTest.AddAccount("Test Account 1", 1); 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")); @@ -799,8 +810,8 @@ TEST(CalendarDataStorage, Update_Two_Calendars_With_Two_Accounts){ CalendarDataStorage UpdateCalendarTest; - UpdateCalendarTest.AddAccount("Test Account 1"); - UpdateCalendarTest.AddAccount("Test Account 2"); + UpdateCalendarTest.AddAccount("Test Account 1", 1); + UpdateCalendarTest.AddAccount("Test Account 2", 2); 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")); @@ -833,9 +844,9 @@ TEST(CalendarDataStorage, Update_Two_Calendars_With_Three_Accounts){ CalendarDataStorage UpdateCalendarTest; - UpdateCalendarTest.AddAccount("Test Account 1"); - UpdateCalendarTest.AddAccount("Test Account 2"); - UpdateCalendarTest.AddAccount("Test Account 3"); + UpdateCalendarTest.AddAccount("Test Account 1", 1); + UpdateCalendarTest.AddAccount("Test Account 2", 2); + UpdateCalendarTest.AddAccount("Test Account 3", 3); 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")); @@ -879,7 +890,7 @@ TEST(CalendarDataStorage, Update_Three_Calendars_With_One_Account){ CalendarDataStorage UpdateCalendarTest; - UpdateCalendarTest.AddAccount("Test Account 1"); + UpdateCalendarTest.AddAccount("Test Account 1", 1); 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")); @@ -907,8 +918,8 @@ TEST(CalendarDataStorage, Update_Three_Calendars_With_Two_Accounts){ CalendarDataStorage UpdateCalendarTest; - UpdateCalendarTest.AddAccount("Test Account 1"); - UpdateCalendarTest.AddAccount("Test Account 2"); + UpdateCalendarTest.AddAccount("Test Account 1", 1); + UpdateCalendarTest.AddAccount("Test Account 2", 2); 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")); @@ -951,9 +962,9 @@ TEST(CalendarDataStorage, Update_Three_Calendars_With_Three_Accounts){ CalendarDataStorage UpdateCalendarTest; - UpdateCalendarTest.AddAccount("Test Account 1"); - UpdateCalendarTest.AddAccount("Test Account 2"); - UpdateCalendarTest.AddAccount("Test Account 3"); + UpdateCalendarTest.AddAccount("Test Account 1", 1); + UpdateCalendarTest.AddAccount("Test Account 2", 2); + UpdateCalendarTest.AddAccount("Test Account 3", 3); 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")); @@ -1012,7 +1023,7 @@ TEST(CalendarDataStorage, Delete_One_Calendar){ CalendarDataStorage DeleteCalendarTest; int calendarID = 0; - DeleteCalendarTest.AddAccount("Test Account 1"); + DeleteCalendarTest.AddAccount("Test Account 1", 1); ASSERT_EQ(CDSCALENDAR_OK, DeleteCalendarTest.AddCalendar(DeleteCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1")); @@ -1028,8 +1039,8 @@ TEST(CalendarDataStorage, Delete_Two_Calendars){ int calendarID1 = 0; int calendarID2 = 0; - DeleteCalendarTest.AddAccount("Test Account 1"); - DeleteCalendarTest.AddAccount("Test Account 2"); + DeleteCalendarTest.AddAccount("Test Account 1", 1); + DeleteCalendarTest.AddAccount("Test Account 2", 2); 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")); @@ -1049,9 +1060,9 @@ TEST(CalendarDataStorage, Delete_Three_Calendars){ int calendarID2 = 0; int calendarID3 = 0; - DeleteCalendarTest.AddAccount("Test Account 1"); - DeleteCalendarTest.AddAccount("Test Account 2"); - DeleteCalendarTest.AddAccount("Test Account 3"); + DeleteCalendarTest.AddAccount("Test Account 1", 1); + DeleteCalendarTest.AddAccount("Test Account 2", 2); + DeleteCalendarTest.AddAccount("Test Account 3", 3); 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")); @@ -1071,7 +1082,7 @@ TEST(CalendarDataStorage, Add_One_Event){ CalendarDataStorage AddEventTest; - AddEventTest.AddAccount("Test Account 1"); + AddEventTest.AddAccount("Test Account 1", 1); AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEventResult = AddEventTest.AddEvent(1, "CalendarEvent1.ics"); @@ -1085,7 +1096,7 @@ TEST(CalendarDataStorage, Add_Two_Events){ CalendarDataStorage AddEventTest; - AddEventTest.AddAccount("Test Account 1"); + AddEventTest.AddAccount("Test Account 1", 1); AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEvent1Result = AddEventTest.AddEvent(1, "CalendarEvent1.ics"); @@ -1104,7 +1115,7 @@ TEST(CalendarDataStorage, Add_Three_Events){ CalendarDataStorage AddEventTest; - AddEventTest.AddAccount("Test Account 1"); + AddEventTest.AddAccount("Test Account 1", 1); AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEvent1Result = AddEventTest.AddEvent(1, "CalendarEvent1.ics"); @@ -1128,7 +1139,7 @@ TEST(CalendarDataStorage, Add_One_Event_And_Get_Event_Basic_Information){ CalendarDataStorage AddEventTest; - AddEventTest.AddAccount("Test Account 1"); + AddEventTest.AddAccount("Test Account 1", 1); AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEventResult = AddEventTest.AddEvent(1, "CalendarEvent1.ics"); @@ -1158,7 +1169,7 @@ TEST(CalendarDataStorage, Add_One_Event_And_Get_Event_Basic_Information_With_Dur CalendarDataStorage AddEventTest; - AddEventTest.AddAccount("Test Account 1"); + AddEventTest.AddAccount("Test Account 1", 1); AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEventResult = AddEventTest.AddEvent(1, "CalendarEvent2.ics"); @@ -1195,7 +1206,7 @@ TEST(CalendarDataStorage, Add_Two_Events_And_Get_Event_Basic_Information){ CalendarDataStorage AddEventTest; - AddEventTest.AddAccount("Test Account 1"); + AddEventTest.AddAccount("Test Account 1", 1); 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"); @@ -1251,7 +1262,7 @@ TEST(CalendarDataStorage, Add_The_Same_Three_Events_And_Get_Event_Information){ CalendarDataStorage AddEventTest; - AddEventTest.AddAccount("Test Account 1"); + AddEventTest.AddAccount("Test Account 1", 1); 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"); @@ -1322,7 +1333,7 @@ TEST(CalendarDataStorage, Add_Three_Events_And_Get_Event_Information){ CalendarDataStorage AddEventTest; - AddEventTest.AddAccount("Test Account 1"); + AddEventTest.AddAccount("Test Account 1", 1); 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"); @@ -1398,7 +1409,7 @@ TEST(CalendarDataStorage, Delete_One_Event){ CalendarDataStorage DeleteEventTest; - DeleteEventTest.AddAccount("Test Account 1"); + DeleteEventTest.AddAccount("Test Account 1", 1); DeleteEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); CDSAddEntryResult addEventResult = DeleteEventTest.AddEvent(1, "CalendarEvent1.ics"); @@ -1412,7 +1423,7 @@ TEST(CalendarDataStorage, Delete_Two_Events){ CalendarDataStorage DeleteEventTest; - DeleteEventTest.AddAccount("Test Account 1"); + DeleteEventTest.AddAccount("Test Account 1", 1); 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"); @@ -1429,7 +1440,7 @@ TEST(CalendarDataStorage, Delete_Three_Events){ CalendarDataStorage DeleteEventTest; - DeleteEventTest.AddAccount("Test Account 1"); + DeleteEventTest.AddAccount("Test Account 1", 1); 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"); @@ -1449,7 +1460,7 @@ TEST(CalendarDataStorage, Delete_One_Calendar_And_Events){ CalendarDataStorage DeleteEventTest; - DeleteEventTest.AddAccount("Test Account 1"); + DeleteEventTest.AddAccount("Test Account 1", 1); 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"); @@ -1467,7 +1478,7 @@ TEST(CalendarDataStorage, Delete_Two_Calendars_And_Events){ CalendarDataStorage DeleteEventTest; - DeleteEventTest.AddAccount("Test Account 1"); + DeleteEventTest.AddAccount("Test Account 1", 1); DeleteEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); DeleteEventTest.AddCalendar(1, "Calendar 1", "calendar2-test", DefaultColour, "Calendar Description 1"); @@ -1501,7 +1512,7 @@ TEST(CalendarDataStorage, Delete_Three_Calendars_And_Events){ CalendarDataStorage DeleteEventTest; - DeleteEventTest.AddAccount("Test Account 1"); + DeleteEventTest.AddAccount("Test Account 1", 1); 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"); @@ -1548,7 +1559,7 @@ TEST(CalendarDataStorage, Delete_One_Account_And_Associated_Data){ CalendarDataStorage DeleteAccountTest; - DeleteAccountTest.AddAccount("Test Account 1"); + DeleteAccountTest.AddAccount("Test Account 1", 1); DeleteAccountTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1"); // Setup and delete the first account. @@ -1571,9 +1582,9 @@ TEST(CalendarDataStorage, Delete_Two_Accounts_And_Associated_Data){ CalendarDataStorage DeleteAccountTest; - DeleteAccountTest.AddAccount("Test Account 1"); - DeleteAccountTest.AddAccount("Test Account 2"); - DeleteAccountTest.AddAccount("Test Account 3"); + DeleteAccountTest.AddAccount("Test Account 1", 1); + DeleteAccountTest.AddAccount("Test Account 2", 2); + DeleteAccountTest.AddAccount("Test Account 3", 3); // Setup and delete the first account. @@ -1617,9 +1628,9 @@ TEST(CalendarDataStorage, Delete_Three_Accounts_And_Associated_Data){ CalendarDataStorage DeleteAccountTest; - DeleteAccountTest.AddAccount("Test Account 1"); - DeleteAccountTest.AddAccount("Test Account 2"); - DeleteAccountTest.AddAccount("Test Account 3"); + DeleteAccountTest.AddAccount("Test Account 1", 1); + DeleteAccountTest.AddAccount("Test Account 2", 2); + DeleteAccountTest.AddAccount("Test Account 3", 3); // Setup and delete the first account. @@ -1681,7 +1692,7 @@ TEST(CalendarDataStorage, Get_List_Of_Events_For_One_Account){ CalendarDataStorage GetEventsListTest; - GetEventsListTest.AddAccount("Test Account 1"); + GetEventsListTest.AddAccount("Test Account 1", 1); // Setup and delete the first account. @@ -1705,7 +1716,7 @@ TEST(CalendarDataStorage, Get_List_Of_Events_For_Two_Accounts){ CalendarDataStorage GetEventsListTest; - GetEventsListTest.AddAccount("Test Account 1"); + GetEventsListTest.AddAccount("Test Account 1", 1); // Setup and delete the first account. @@ -1743,7 +1754,7 @@ TEST(CalendarDataStorage, Get_List_Of_Events_For_Three_Accounts){ CalendarDataStorage GetEventsListTest; - GetEventsListTest.AddAccount("Test Account 1"); + GetEventsListTest.AddAccount("Test Account 1", 1); // Setup and delete the first account. @@ -1793,7 +1804,7 @@ TEST(CalendarDataStorage, Get_List_Of_Calendars_For_One_Account){ CalendarDataStorage GetEventsListTest; - GetEventsListTest.AddAccount("Test Account 1"); + GetEventsListTest.AddAccount("Test Account 1", 1); // Setup the first account. @@ -1819,8 +1830,8 @@ TEST(CalendarDataStorage, Get_List_Of_Calendars_For_Two_Accounts){ CalendarDataStorage GetEventsListTest; - GetEventsListTest.AddAccount("Test Account 1"); - GetEventsListTest.AddAccount("Test Account 2"); + GetEventsListTest.AddAccount("Test Account 1", 1); + GetEventsListTest.AddAccount("Test Account 2", 2); // Setup the first account. @@ -1862,9 +1873,9 @@ TEST(CalendarDataStorage, Get_List_Of_Calendars_For_Three_Accounts){ CalendarDataStorage GetEventsListTest; - GetEventsListTest.AddAccount("Test Account 1"); - GetEventsListTest.AddAccount("Test Account 2"); - GetEventsListTest.AddAccount("Test Account 3"); + GetEventsListTest.AddAccount("Test Account 1", 1); + GetEventsListTest.AddAccount("Test Account 2", 2); + GetEventsListTest.AddAccount("Test Account 3", 3); // Setup the first account. -- 2.39.5