TEST(CalDAV, BasicTests){
- CalDAVConnectionData ConnPlain;
- CalDAVConnectionData ConnNormal;
- CalDAVConnectionData ConnInvalidSSL;
- CalDAVConnectionData ConnTimeout;
- ProcessConnectionDataFileResult DataFileResult;
+ CalDAVConnectionData connPlain;
+ CalDAVConnectionData connNormal;
+ CalDAVConnectionData connInvalidSSL;
+ CalDAVConnectionData connTimeout;
+ ProcessConnectionDataFileResult dataFileResult;
- bool ValidDataPlain = false;
- bool ValidDataNormal = false;
- bool ValidDataInvalidSSL = false;
- bool ValidDataTimeout = false;
+ bool validDataPlain = false;
+ bool validDataNormal = false;
+ bool validDataInvalidSSL = false;
+ bool validDataTimeout = false;
// Attempt to read the caldavtest-plain.auth file.
- DataFileResult = ProcessConnectionDataFile("caldavtest-plain.auth", &ConnPlain);
- if (DataFileResult == PROCESSCONNECTIONDATAFILE_OK){
- ValidDataPlain = true;
+ dataFileResult = ProcessConnectionDataFile("caldavtest-plain.auth", &connPlain);
+ if (dataFileResult == PROCESSCONNECTIONDATAFILE_OK){
+ validDataPlain = true;
}
// Attempt to read the caldavtest.auth file.
- DataFileResult = ProcessConnectionDataFile("caldavtest.auth", &ConnNormal);
- if (DataFileResult == PROCESSCONNECTIONDATAFILE_OK){
- ValidDataNormal = true;
+ dataFileResult = ProcessConnectionDataFile("caldavtest.auth", &connNormal);
+ if (dataFileResult == PROCESSCONNECTIONDATAFILE_OK){
+ validDataNormal = true;
}
// Attempt to read the caldavtest-fail.auth file.
- DataFileResult = ProcessConnectionDataFile("caldavtest-fail.auth", &ConnInvalidSSL);
- if (DataFileResult == PROCESSCONNECTIONDATAFILE_OK){
- ValidDataInvalidSSL = true;
+ dataFileResult = ProcessConnectionDataFile("caldavtest-fail.auth", &connInvalidSSL);
+ if (dataFileResult == PROCESSCONNECTIONDATAFILE_OK){
+ validDataInvalidSSL = true;
}
// Attempt to read the caldavtest-timeout.auth file.
- DataFileResult = ProcessConnectionDataFile("caldavtest-timeout.auth", &ConnTimeout);
- if (DataFileResult == PROCESSCONNECTIONDATAFILE_OK){
- ValidDataTimeout = true;
+ dataFileResult = ProcessConnectionDataFile("caldavtest-timeout.auth", &connTimeout);
+ if (dataFileResult == PROCESSCONNECTIONDATAFILE_OK){
+ validDataTimeout = true;
}
- if (ValidDataPlain == false){
+ if (validDataPlain == false){
// Cannot read the caldavtest-plain.auth file properly.
}
- if (ValidDataNormal == false){
+ if (validDataNormal == false){
// Cannot read the caldavtest.auth file properly.
}
- if (ValidDataInvalidSSL == false){
+ if (validDataInvalidSSL == false){
// Cannot read the caldavtest-fail.auth file properly.
}
- if (ValidDataTimeout == false){
+ if (validDataTimeout == false){
// Cannot read the caldavtest-timeout.auth file properly.
}
- ASSERT_EQ(true, ValidDataPlain);
- ASSERT_EQ(true, ValidDataNormal);
- ASSERT_EQ(true, ValidDataInvalidSSL);
- ASSERT_EQ(true, ValidDataTimeout);
+ ASSERT_EQ(true, validDataPlain);
+ ASSERT_EQ(true, validDataNormal);
+ ASSERT_EQ(true, validDataInvalidSSL);
+ ASSERT_EQ(true, validDataTimeout);
// (*nix version) Setup an initial connection (just plain
// text).
- CalDAV CalDAVPlain;
- CalDAVPlain.SetupConnectionData(&ConnPlain);
+ CalDAV calDAVPlain;
+ calDAVPlain.SetupConnectionData(&connPlain);
// Verify that the settings match with the CalDAVConnectionData
// passed.
- CalDAVStatus CalDAVPlainStatus = CalDAVPlain.GetConnectionData();
+ CalDAVStatus calDAVPlainStatus = calDAVPlain.GetConnectionData();
- ASSERT_EQ(CalDAVPlainStatus.Hostname, ConnPlain.Hostname);
- ASSERT_EQ(CalDAVPlainStatus.Username, ConnPlain.Username);
- ASSERT_EQ(CalDAVPlainStatus.Port, ConnPlain.Port);
- ASSERT_EQ(CalDAVPlainStatus.Prefix, ConnPlain.Prefix);
- ASSERT_EQ(CalDAVPlainStatus.UseSSL, ConnPlain.UseSSL);
+ ASSERT_EQ(calDAVPlainStatus.Hostname, connPlain.Hostname);
+ ASSERT_EQ(calDAVPlainStatus.Username, connPlain.Username);
+ ASSERT_EQ(calDAVPlainStatus.Port, connPlain.Port);
+ ASSERT_EQ(calDAVPlainStatus.Prefix, connPlain.Prefix);
+ ASSERT_EQ(calDAVPlainStatus.UseSSL, connPlain.UseSSL);
// Verify that the connection was successful.
- CalDAVServerResult ConnResult = CalDAVPlain.Connect();
+ CalDAVServerResult connResult = CalDAVPlain.Connect();
- ASSERT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ ASSERT_EQ(CALDAVQUERYRESULT_OK, connResult.Result);
+ ASSERT_EQ(200, connResult.HTTPCode);
+ ASSERT_EQ(CURLE_OK, connResult.Code);
// Do another connection and this time the connection should
// fail due to being an invalid host name.
- CalDAVConnectionData ConnPlainFail;
- ConnPlainFail.Hostname = "server.invalid";
- ConnPlainFail.Username = "fail";
- ConnPlainFail.Password = "fail";
- ConnPlainFail.Port = 80;
- ConnPlainFail.UseSSL = false;
+ CalDAVConnectionData connPlainFail;
+ connPlainFail.Hostname = "server.invalid";
+ connPlainFail.Username = "fail";
+ connPlainFail.Password = "fail";
+ connPlainFail.Port = 80;
+ connPlainFail.UseSSL = false;
// Setup the CalDAV connection object.
- CalDAV CalDAVPlainFail;
- CalDAVPlainFail.SetupConnectionData(&ConnPlainFail);
+ CalDAV calDAVPlainFail;
+ calDAVPlainFail.SetupConnectionData(&connPlainFail);
// Setup the CalDAVStatus object.
- CalDAVStatus CalDAVPlainFailStatus = CalDAVPlain.GetConnectionData();
+ CalDAVStatus calDAVPlainFailStatus = calDAVPlain.GetConnectionData();
// Connect and fail.
- ConnResult = CalDAVPlainFail.Connect();
+ connResult = calDAVPlainFail.Connect();
- ASSERT_EQ(CALDAVQUERYRESULT_SERVERERROR, ConnResult.Result);
- ASSERT_EQ(0, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_COULDNT_RESOLVE_HOST, ConnResult.Code);
+ ASSERT_EQ(CALDAVQUERYRESULT_SERVERERROR, connResult.Result);
+ ASSERT_EQ(0, connResult.HTTPCode);
+ ASSERT_EQ(CURLE_COULDNT_RESOLVE_HOST, connResult.Code);
// (*nix version) Setup an initial connection (with a valid
// SSL certificate).
- CalDAV CalDAVNormal;
- CalDAVNormal.SetupConnectionData(&ConnNormal);
+ CalDAV calDAVNormal;
+ calDAVNormal.SetupConnectionData(&connNormal);
// Verify that the settings match with the CalDAVConnectionData
// passed.
- CalDAVStatus CalDAVNormalStatus = CalDAVNormal.GetConnectionData();
+ CalDAVStatus calDAVNormalStatus = calDAVNormal.GetConnectionData();
- ASSERT_EQ(CalDAVNormalStatus.Hostname, ConnNormal.Hostname);
- ASSERT_EQ(CalDAVNormalStatus.Username, ConnNormal.Username);
- ASSERT_EQ(CalDAVNormalStatus.Port, ConnNormal.Port);
- ASSERT_EQ(CalDAVNormalStatus.Prefix, ConnNormal.Prefix);
- ASSERT_EQ(CalDAVNormalStatus.UseSSL, ConnNormal.UseSSL);
+ ASSERT_EQ(calDAVNormalStatus.Hostname, connNormal.Hostname);
+ ASSERT_EQ(calDAVNormalStatus.Username, connNormal.Username);
+ ASSERT_EQ(calDAVNormalStatus.Port, connNormal.Port);
+ ASSERT_EQ(calDAVNormalStatus.Prefix, connNormal.Prefix);
+ ASSERT_EQ(calDAVNormalStatus.UseSSL, connNormal.UseSSL);
// Verify that the connection was successful (with a valid
// SSL certificate).
- ConnResult = CalDAVNormal.Connect();
+ connResult = CalDAVNormal.Connect();
- ASSERT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ ASSERT_EQ(CALDAVQUERYRESULT_OK, connResult.Result);
+ ASSERT_EQ(200, connResult.HTTPCode);
+ ASSERT_EQ(CURLE_OK, connResult.Code);
// (*nix version) Setup an initial connection on a server that
// will fail due to having an invalid SSL certificate.
- CalDAV CalDAVInvalidSSL;
- CalDAVInvalidSSL.SetupConnectionData(&ConnInvalidSSL);
+ CalDAV calDAVInvalidSSL;
+ calDAVInvalidSSL.SetupConnectionData(&connInvalidSSL);
// Verify that the settings match with the CalDAVConnectionData
// passed.
- CalDAVStatus CalDAVInvalidSSLStatus = CalDAVInvalidSSL.GetConnectionData();
+ CalDAVStatus calDAVInvalidSSLStatus = calDAVInvalidSSL.GetConnectionData();
- ASSERT_EQ(CalDAVInvalidSSLStatus.Hostname, ConnInvalidSSL.Hostname);
- ASSERT_EQ(CalDAVInvalidSSLStatus.Username, ConnInvalidSSL.Username);
- ASSERT_EQ(CalDAVInvalidSSLStatus.Port, ConnInvalidSSL.Port);
- ASSERT_EQ(CalDAVInvalidSSLStatus.Prefix, ConnInvalidSSL.Prefix);
- ASSERT_EQ(CalDAVInvalidSSLStatus.UseSSL, ConnInvalidSSL.UseSSL);
+ ASSERT_EQ(calDAVInvalidSSLStatus.Hostname, connInvalidSSL.Hostname);
+ ASSERT_EQ(calDAVInvalidSSLStatus.Username, connInvalidSSL.Username);
+ ASSERT_EQ(calDAVInvalidSSLStatus.Port, connInvalidSSL.Port);
+ ASSERT_EQ(calDAVInvalidSSLStatus.Prefix, connInvalidSSL.Prefix);
+ ASSERT_EQ(calDAVInvalidSSLStatus.UseSSL, connInvalidSSL.UseSSL);
// Verify that the connection had failed. (with an invalid
// SSL certificate).
- ConnResult = CalDAVInvalidSSL.Connect();
+ connResult = calDAVInvalidSSL.Connect();
- ASSERT_EQ(CALDAVQUERYRESULT_SERVERERROR, ConnResult.Result);
- ASSERT_EQ(0, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_SSL_CACERT, ConnResult.Code);
+ ASSERT_EQ(CALDAVQUERYRESULT_SERVERERROR, connResult.Result);
+ ASSERT_EQ(0, connResult.HTTPCode);
+ ASSERT_EQ(CURLE_SSL_CACERT, connResult.Code);
// (*nix version) Setup an inital connection on a server where
// a timeout occurs.
- ConnTimeout.Timeout = 5;
+ connTimeout.Timeout = 5;
- CalDAV CalDAVTimeout;
- CalDAVTimeout.SetupConnectionData(&ConnTimeout);
+ CalDAV calDAVTimeout;
+ calDAVTimeout.SetupConnectionData(&connTimeout);
// Verify that the settings match with the CalDAVConnectionData
// passed.
- CalDAVStatus CalDAVTimeoutStatus = CalDAVTimeout.GetConnectionData();
+ CalDAVStatus calDAVTimeoutStatus = calDAVTimeout.GetConnectionData();
- ASSERT_EQ(CalDAVTimeoutStatus.Hostname, ConnTimeout.Hostname);
- ASSERT_EQ(CalDAVTimeoutStatus.Username, ConnTimeout.Username);
- ASSERT_EQ(CalDAVTimeoutStatus.Port, ConnTimeout.Port);
- ASSERT_EQ(CalDAVTimeoutStatus.Prefix, ConnTimeout.Prefix);
- ASSERT_EQ(CalDAVTimeoutStatus.Timeout, ConnTimeout.Timeout);
- ASSERT_EQ(CalDAVTimeoutStatus.UseSSL, ConnTimeout.UseSSL);
+ ASSERT_EQ(calDAVTimeoutStatus.Hostname, connTimeout.Hostname);
+ ASSERT_EQ(calDAVTimeoutStatus.Username, connTimeout.Username);
+ ASSERT_EQ(calDAVTimeoutStatus.Port, connTimeout.Port);
+ ASSERT_EQ(calDAVTimeoutStatus.Prefix, connTimeout.Prefix);
+ ASSERT_EQ(calDAVTimeoutStatus.Timeout, connTimeout.Timeout);
+ ASSERT_EQ(calDAVTimeoutStatus.UseSSL, connTimeout.UseSSL);
// Verify that the connection had timed out.
- ConnResult = CalDAVTimeout.Connect();
+ connResult = calDAVTimeout.Connect();
- ASSERT_EQ(CALDAVQUERYRESULT_SERVERERROR, ConnResult.Result);
- ASSERT_EQ(0, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OPERATION_TIMEDOUT, ConnResult.Code);
+ ASSERT_EQ(CALDAVQUERYRESULT_SERVERERROR, connResult.Result);
+ ASSERT_EQ(0, connResult.HTTPCode);
+ ASSERT_EQ(CURLE_OPERATION_TIMEDOUT, connResult.Code);
}
TEST(CalDAV, BuildServerAddress){
- CalDAVConnectionData ConnNormal;
- ProcessConnectionDataFileResult DataFileResult;
- bool ValidDataNormal = false;
+ CalDAVConnectionData connNormal;
+ ProcessConnectionDataFileResult dataFileResult;
+ bool validDataNormal = false;
// Attempt to read the caldavtest.auth file.
- DataFileResult = ProcessConnectionDataFile("caldavtest.auth", &ConnNormal);
- if (DataFileResult == PROCESSCONNECTIONDATAFILE_OK){
- ValidDataNormal = true;
+ dataFileResult = ProcessConnectionDataFile("caldavtest.auth", &connNormal);
+ if (dataFileResult == PROCESSCONNECTIONDATAFILE_OK){
+ validDataNormal = true;
}
- if (ValidDataNormal == false){
+ if (validDataNormal == false){
// Cannot read the caldavtest.auth file properly.
}
- ASSERT_EQ(true, ValidDataNormal);
+ ASSERT_EQ(true, validDataNormal);
// Setup the server address to check.
- string ServerAddress;
+ string serverAddress;
// Setup the server address.
- if (ConnNormal.UseSSL == true){
- ServerAddress += "https://";
+ if (connNormal.UseSSL == true){
+ serverAddress += "https://";
} else {
- ServerAddress += "http://";
+ serverAddress += "http://";
}
- ServerAddress += ConnNormal.Hostname;
+ serverAddress += connNormal.hostname;
// Check if server port is 80, otherwise
// specifiy the port number in the address.
- if (ConnNormal.Port != 80){
- ServerAddress += ":";
- ServerAddress += to_string(ConnNormal.Port);
+ if (connNormal.port != 80){
+ serverAddress += ":";
+ serverAddress += to_string(ConnNormal.Port);
}
- ServerAddress += "/principals/";
+ serverAddress += "/principals/";
- ASSERT_EQ(ServerAddress, BuildServerAddress(&ConnNormal, "/principals/"));
+ ASSERT_EQ(serverAddress, BuildServerAddress(&connNormal, "/principals/"));
}
TEST(CalDAV, CalendarServerSupport){
- CalDAVConnectionData ConnNormal;
+ CalDAVConnectionData connNormal;
- bool ValidDataNormal = false;
+ bool validDataNormal = false;
// Attempt to read the caldavtest.auth file.
- ProcessConnectionDataFileResult DataFileResult = ProcessConnectionDataFile("caldavtest.auth", &ConnNormal);
- if (DataFileResult == PROCESSCONNECTIONDATAFILE_OK){
- ValidDataNormal = true;
+ ProcessConnectionDataFileResult dataFileResult = ProcessConnectionDataFile("caldavtest.auth", &connNormal);
+ if (dataFileResult == PROCESSCONNECTIONDATAFILE_OK){
+ validDataNormal = true;
}
- ASSERT_EQ(true, ValidDataNormal);
+ ASSERT_EQ(true, validDataNormal);
// Setup the connection.
- CalDAV ServerConnection;
+ CalDAV serverConnection;
- ServerConnection.SetupConnectionData(&ConnNormal);
+ serverConnection.SetupConnectionData(&connNormal);
// Verify the connection settings.
- CalDAVStatus CalDAVStatus = ServerConnection.GetConnectionData();
+ CalDAVStatus calDAVStatus = serverConnection.GetConnectionData();
- ASSERT_EQ(CalDAVStatus.Hostname, ConnNormal.Hostname);
- ASSERT_EQ(CalDAVStatus.Username, ConnNormal.Username);
- ASSERT_EQ(CalDAVStatus.Port, ConnNormal.Port);
- ASSERT_EQ(CalDAVStatus.Prefix, ConnNormal.Prefix);
- ASSERT_EQ(CalDAVStatus.UseSSL, ConnNormal.UseSSL);
+ ASSERT_EQ(calDAVStatus.hostname, connNormal.hostname);
+ ASSERT_EQ(calDAVStatus.username, connNormal.username);
+ ASSERT_EQ(calDAVStatus.port, connNormal.port);
+ ASSERT_EQ(calDAVStatus.prefix, connNormal.prefix);
+ ASSERT_EQ(calDAVStatus.useSSL, connNormal.useSSL);
// Connect to the server.
- CalDAVServerResult ConnResult = ServerConnection.Connect();
+ CalDAVServerResult connResult = serverConnection.Connect();
- ASSERT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ ASSERT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(200, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Check for basic support of the calendar server.
- CalDAVServerSupport ConnSupport = ServerConnection.GetServerSupport();
+ CalDAVServerSupport connSupport = serverConnection.GetServerSupport();
- ASSERT_EQ(true, ConnSupport.BasicSupport);
+ ASSERT_EQ(true, connSupport.basicSupport);
}
TEST(CalDAV, GetCalendarHome){
- CalDAVConnectionData ConnNormal;
+ CalDAVConnectionData connNormal;
- bool ValidDataNormal = false;
+ bool validDataNormal = false;
// Attempt to read the caldavtest.auth file.
- ProcessConnectionDataFileResult DataFileResult = ProcessConnectionDataFile("caldavtest.auth", &ConnNormal);
- if (DataFileResult == PROCESSCONNECTIONDATAFILE_OK){
- ValidDataNormal = true;
+ ProcessConnectionDataFileResult dataFileResult = ProcessConnectionDataFile("caldavtest.auth", &connNormal);
+ if (dataFileResult == PROCESSCONNECTIONDATAFILE_OK){
+ validDataNormal = true;
}
- ASSERT_EQ(true, ValidDataNormal);
+ ASSERT_EQ(true, validDataNormal);
// Setup the connection.
- CalDAV ServerConnection;
+ CalDAV serverConnection;
- ServerConnection.SetupConnectionData(&ConnNormal);
+ serverConnection.SetupConnectionData(&connNormal);
// Verify the connection settings.
- CalDAVStatus CalDAVStatus = ServerConnection.GetConnectionData();
+ CalDAVStatus calDAVStatus = serverConnection.GetConnectionData();
- ASSERT_EQ(CalDAVStatus.Hostname, ConnNormal.Hostname);
- ASSERT_EQ(CalDAVStatus.Username, ConnNormal.Username);
- ASSERT_EQ(CalDAVStatus.Port, ConnNormal.Port);
- ASSERT_EQ(CalDAVStatus.Prefix, ConnNormal.Prefix);
- ASSERT_EQ(CalDAVStatus.UseSSL, ConnNormal.UseSSL);
+ ASSERT_EQ(calDAVStatus.hostname, connNormal.hostname);
+ ASSERT_EQ(calDAVStatus.username, connNormal.username);
+ ASSERT_EQ(calDAVStatus.port, connNormal.port);
+ ASSERT_EQ(calDAVStatus.prefix, connNormal.prefix);
+ ASSERT_EQ(calDAVStatus.useSSL, connNormal.useSSL);
// Connect to the server.
- CalDAVServerResult ConnResult = ServerConnection.Connect();
+ CalDAVServerResult connResult = serverConnection.Connect();
- ASSERT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ ASSERT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(200, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Check for basic support of the calendar server.
- CalDAVServerSupport ConnSupport = ServerConnection.GetServerSupport();
+ CalDAVServerSupport connSupport = serverConnection.GetServerSupport();
- ASSERT_EQ(true, ConnSupport.BasicSupport);
+ ASSERT_EQ(true, connSupport.basicSupport);
// Get the user principal.
- string CurrentUserPrincipal = ServerConnection.GetUserPrincipal();
+ string currentUserPrincipal = serverConnection.GetUserPrincipal();
// Check the response from the server.
- ConnResult = ServerConnection.GetServerResult();
+ connResult = cerverConnection.GetServerResult();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(207, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.Result);
+ ASSERT_EQ(207, connResult.HTTPCode);
+ ASSERT_EQ(CURLE_OK, connResult.Code);
// Get the calendar home.
- string CalendarHome = ServerConnection.GetCalendarHome(CurrentUserPrincipal);
+ string calendarHome = serverConnection.GetCalendarHome(CurrentUserPrincipal);
// Check the response from the server.
- ConnResult = ServerConnection.GetServerResult();
+ connResult = serverConnection.GetServerResult();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(207, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(207, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
}
TEST(CalDAV, ListCalendars){
- CalDAVConnectionData ConnNormal;
- string CurrentUserPrincipal;
+ CalDAVConnectionData connNormal;
+ string currentUserPrincipal;
- bool ValidDataNormal = false;
+ bool validDataNormal = false;
// Attempt to read the caldavtest.auth file.
- ProcessConnectionDataFileResult DataFileResult = ProcessConnectionDataFile("caldavtest.auth", &ConnNormal);
- if (DataFileResult == PROCESSCONNECTIONDATAFILE_OK){
- ValidDataNormal = true;
+ ProcessConnectionDataFileResult dataFileResult = ProcessConnectionDataFile("caldavtest.auth", &connNormal);
+ if (dataFileResult == PROCESSCONNECTIONDATAFILE_OK){
+ validDataNormal = true;
}
- ASSERT_EQ(true, ValidDataNormal);
+ ASSERT_EQ(true, validDataNormal);
// Setup the connection.
- CalDAV ServerConnection;
+ CalDAV serverConnection;
- ServerConnection.SetupConnectionData(&ConnNormal);
+ serverConnection.SetupConnectionData(&connNormal);
// Verify the connection settings.
- CalDAVStatus CalDAVStatus = ServerConnection.GetConnectionData();
+ CalDAVStatus calDAVStatus = serverConnection.GetConnectionData();
- ASSERT_EQ(CalDAVStatus.Hostname, ConnNormal.Hostname);
- ASSERT_EQ(CalDAVStatus.Username, ConnNormal.Username);
- ASSERT_EQ(CalDAVStatus.Port, ConnNormal.Port);
- ASSERT_EQ(CalDAVStatus.Prefix, ConnNormal.Prefix);
- ASSERT_EQ(CalDAVStatus.UseSSL, ConnNormal.UseSSL);
+ ASSERT_EQ(calDAVStatus.hostname, connNormal.hostname);
+ ASSERT_EQ(calDAVStatus.username, connNormal.username);
+ ASSERT_EQ(calDAVStatus.port, connNormal.port);
+ ASSERT_EQ(calDAVStatus.prefix, connNormal.prefix);
+ ASSERT_EQ(calDAVStatus.useSSL, connNormal.useSSL);
// Connect to the server.
- CalDAVServerResult ConnResult = ServerConnection.Connect();
+ CalDAVServerResult connResult = serverConnection.Connect();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(200, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Check that the server supports CalDAV.
- CalDAVServerSupport ConnSupport = ServerConnection.GetServerSupport();
- ConnResult = ServerConnection.GetServerResult();
+ CalDAVServerSupport connSupport = serverConnection.GetServerSupport();
+ connResult = serverConnection.GetServerResult();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
- ASSERT_EQ(true, ConnSupport.BasicSupport);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(200, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
+ ASSERT_EQ(true, connSupport.basicSupport);
// Get the list of calendars.
- CalDAVCalendarList CalendarList = ServerConnection.GetCalendars();
+ CalDAVCalendarList calendarList = serverConnection.GetCalendars();
// Check the response result from the server.
- ConnResult = ServerConnection.GetServerResult();
+ connResult = serverConnection.GetServerResult();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(207, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(207, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
}
TEST(CalDAV, AddCalendar){
- CalDAVConnectionData ConnNormal;
- string CurrentUserPrincipal;
+ CalDAVConnectionData connNormal;
+ string currentUserPrincipal;
- bool ValidDataNormal = false;
+ bool validDataNormal = false;
// Attempt to read the caldavtest.auth file.
- ProcessConnectionDataFileResult DataFileResult = ProcessConnectionDataFile("caldavtest.auth", &ConnNormal);
- if (DataFileResult == PROCESSCONNECTIONDATAFILE_OK){
- ValidDataNormal = true;
+ ProcessConnectionDataFileResult dataFileResult = ProcessConnectionDataFile("caldavtest.auth", &connNormal);
+ if (dataFileResult == PROCESSCONNECTIONDATAFILE_OK){
+ validDataNormal = true;
}
- ASSERT_EQ(true, ValidDataNormal);
+ ASSERT_EQ(true, validDataNormal);
// Setup the connection.
- CalDAV ServerConnection;
+ CalDAV serverConnection;
- ServerConnection.SetupConnectionData(&ConnNormal);
+ serverConnection.SetupConnectionData(&connNormal);
// Verify the connection settings.
- CalDAVStatus CalDAVStatus = ServerConnection.GetConnectionData();
+ CalDAVStatus calDAVStatus = serverConnection.GetConnectionData();
- ASSERT_EQ(CalDAVStatus.Hostname, ConnNormal.Hostname);
- ASSERT_EQ(CalDAVStatus.Username, ConnNormal.Username);
- ASSERT_EQ(CalDAVStatus.Port, ConnNormal.Port);
- ASSERT_EQ(CalDAVStatus.Prefix, ConnNormal.Prefix);
- ASSERT_EQ(CalDAVStatus.UseSSL, ConnNormal.UseSSL);
+ ASSERT_EQ(calDAVStatus.hostname, connNormal.hostname);
+ ASSERT_EQ(calDAVStatus.username, connNormal.username);
+ ASSERT_EQ(calDAVStatus.port, connNormal.port);
+ ASSERT_EQ(calDAVStatus.prefix, connNormal.prefix);
+ ASSERT_EQ(calDAVStatus.useSSL, connNormal.useSSL);
// Connect to the server.
- CalDAVServerResult ConnResult = ServerConnection.Connect();
+ CalDAVServerResult connResult = serverConnection.Connect();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.Result);
+ ASSERT_EQ(200, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Add a calendar to the server.
- ConnResult = ServerConnection.AddCalendar("New Calendar");
+ connResult = serverConnection.AddCalendar("New Calendar");
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(201, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(201, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
}
TEST(CalDAV, EditCalendar){
- CalDAVConnectionData ConnNormal;
- string CurrentUserPrincipal;
+ CalDAVConnectionData connNormal;
+ string currentUserPrincipal;
- bool ValidDataNormal = false;
+ bool validDataNormal = false;
// Attempt to read the caldavtest.auth file.
- ProcessConnectionDataFileResult DataFileResult = ProcessConnectionDataFile("caldavtest.auth", &ConnNormal);
- if (DataFileResult == PROCESSCONNECTIONDATAFILE_OK){
- ValidDataNormal = true;
+ ProcessConnectionDataFileResult dataFileResult = ProcessConnectionDataFile("caldavtest.auth", &connNormal);
+ if (dataFileResult == PROCESSCONNECTIONDATAFILE_OK){
+ validDataNormal = true;
}
- ASSERT_EQ(true, ValidDataNormal);
+ ASSERT_EQ(true, validDataNormal);
// Setup the connection.
- CalDAV ServerConnection;
+ CalDAV serverConnection;
- ServerConnection.SetupConnectionData(&ConnNormal);
+ serverConnection.SetupConnectionData(&connNormal);
// Verify the connection settings.
- CalDAVStatus CalDAVStatus = ServerConnection.GetConnectionData();
+ CalDAVStatus calDAVStatus = serverConnection.GetConnectionData();
- ASSERT_EQ(CalDAVStatus.Hostname, ConnNormal.Hostname);
- ASSERT_EQ(CalDAVStatus.Username, ConnNormal.Username);
- ASSERT_EQ(CalDAVStatus.Port, ConnNormal.Port);
- ASSERT_EQ(CalDAVStatus.Prefix, ConnNormal.Prefix);
- ASSERT_EQ(CalDAVStatus.UseSSL, ConnNormal.UseSSL);
+ ASSERT_EQ(calDAVStatus.hostname, connNormal.hostname);
+ ASSERT_EQ(calDAVStatus.username, connNormal.username);
+ ASSERT_EQ(calDAVStatus.port, connNormal.port);
+ ASSERT_EQ(calDAVStatus.prefix, connNormal.prefix);
+ ASSERT_EQ(calDAVStatus.useSSL, connNormal.useSSL);
// Connect to the server.
- CalDAVServerResult ConnResult = ServerConnection.Connect();
+ CalDAVServerResult connResult = serverConnection.Connect();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(200, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Check that the server supports CalDAV.
- CalDAVServerSupport ConnSupport = ServerConnection.GetServerSupport();
- ConnResult = ServerConnection.GetServerResult();
+ CalDAVServerSupport connSupport = serverConnection.GetServerSupport();
+ connResult = serverConnection.GetServerResult();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
- ASSERT_EQ(true, ConnSupport.BasicSupport);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.Result);
+ ASSERT_EQ(200, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
+ ASSERT_EQ(true, connSupport.basicSupport);
// Add a calendar to the server.
- ConnResult = ServerConnection.AddCalendar("Calendar To Edit");
+ connResult = serverConnection.AddCalendar("Calendar To Edit");
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(201, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(201, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Get the list of calendars.
- CalDAVCalendarList CalendarList = ServerConnection.GetCalendars();
+ CalDAVCalendarList calendarList = serverConnection.GetCalendars();
// Check the response result from the server.
- ConnResult = ServerConnection.GetServerResult();
+ connResult = serverConnection.GetServerResult();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(207, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(207, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Find the calendar containing the name "Calendar To Edit"
// created earlier.
- int ItemSeek = 0;
- bool ItemFound = false;
+ int itemSeek = 0;
+ bool itemFound = false;
- for (map<int,string>::iterator CalendarNameIter = CalendarList.Name.begin();
- CalendarNameIter != CalendarList.Name.end(); CalendarNameIter++){
+ for (map<int,string>::iterator calendarNameIter = calendarList.name.begin();
+ calendarNameIter != calendarList.name.end(); calendarNameIter++){
- if (CalendarNameIter->second == "Calendar To Edit"){
- ItemFound = true;
+ if (calendarNameIter->second == "Calendar To Edit"){
+ itemFound = true;
break;
}
- ItemSeek++;
+ itemSeek++;
}
- ASSERT_NE(false, ItemFound);
+ ASSERT_NE(false, itemFound);
// Edit the name of the calendar.
- string CalendarEditHREF = CalendarList.HREF[ItemSeek];
- string NewCalendarName = "Edited Calendar";
+ string calendarEditHREF = calendarList.href[itemSeek];
+ string newCalendarName = "Edited Calendar";
- ConnResult = ServerConnection.EditCalendar(&CalendarEditHREF, &NewCalendarName);
+ connResult = serverConnection.EditCalendar(&calendarEditHREF, &newCalendarName);
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(207, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(207, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Edit the colour of the calendar.
- Colour NewColour;
+ Colour newColour;
- NewColour.red = 255;
- NewColour.green = 0;
- NewColour.blue = 0;
- NewColour.alpha = 0;
+ newColour.red = 255;
+ newColour.green = 0;
+ newColour.blue = 0;
+ newColour.alpha = 0;
- ConnResult = ServerConnection.EditCalendar(&CalendarEditHREF, &NewColour);
+ connResult = serverConnection.EditCalendar(&calendarEditHREF, &newColour);
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(207, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(207, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Edit the description of the calendar.
- string NewCalendarDescription = "Update Calendar Description";
+ string newCalendarDescription = "Update Calendar Description";
- ConnResult = ServerConnection.EditCalendarDescription(&CalendarEditHREF, &NewCalendarDescription);
+ connResult = serverConnection.EditCalendarDescription(&calendarEditHREF, &newCalendarDescription);
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(207, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(207, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Edit the order of the calendar.
- int NewCalendarOrder = 30;
+ int newCalendarOrder = 30;
- ConnResult = ServerConnection.EditCalendar(&CalendarEditHREF, &NewCalendarOrder);
+ connResult = serverConnection.EditCalendar(&calendarEditHREF, &newCalendarOrder);
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(207, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(207, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Edit all of the available properties of the calendar.
- NewCalendarName = "Calendar Edited Again";
- NewCalendarDescription = "Another updated calendar description";
- NewColour.red = 0;
- NewColour.green = 255;
- NewColour.blue = 0;
- NewColour.alpha = 0;
- NewCalendarOrder = 40;
+ newCalendarName = "Calendar Edited Again";
+ newCalendarDescription = "Another updated calendar description";
+ newColour.red = 0;
+ newColour.green = 255;
+ newColour.blue = 0;
+ newColour.alpha = 0;
+ newCalendarOrder = 40;
- ConnResult = ServerConnection.EditCalendar(&CalendarEditHREF,
- &NewCalendarName,
- &NewColour,
- &NewCalendarDescription,
- &NewCalendarOrder);
+ connResult = serverConnection.EditCalendar(&calendarEditHREF,
+ &newCalendarName,
+ &newColour,
+ &newCalendarDescription,
+ &newCalendarOrder);
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(207, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(207, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
}
TEST(CalDAV, DeleteCalendar){
- CalDAVConnectionData ConnNormal;
- string CurrentUserPrincipal;
+ CalDAVConnectionData connNormal;
+ string currentUserPrincipal;
- bool ValidDataNormal = false;
+ bool validDataNormal = false;
// Attempt to read the caldavtest.auth file.
- ProcessConnectionDataFileResult DataFileResult = ProcessConnectionDataFile("caldavtest.auth", &ConnNormal);
- if (DataFileResult == PROCESSCONNECTIONDATAFILE_OK){
- ValidDataNormal = true;
+ ProcessConnectionDataFileResult dataFileResult = ProcessConnectionDataFile("caldavtest.auth", &connNormal);
+ if (dataFileResult == PROCESSCONNECTIONDATAFILE_OK){
+ validDataNormal = true;
}
- ASSERT_EQ(true, ValidDataNormal);
+ ASSERT_EQ(true, validDataNormal);
// Setup the connection.
- CalDAV ServerConnection;
+ CalDAV serverConnection;
- ServerConnection.SetupConnectionData(&ConnNormal);
+ serverConnection.SetupConnectionData(&connNormal);
// Verify the connection settings.
- CalDAVStatus CalDAVStatus = ServerConnection.GetConnectionData();
+ CalDAVStatus calDAVStatus = serverConnection.GetConnectionData();
- ASSERT_EQ(CalDAVStatus.Hostname, ConnNormal.Hostname);
- ASSERT_EQ(CalDAVStatus.Username, ConnNormal.Username);
- ASSERT_EQ(CalDAVStatus.Port, ConnNormal.Port);
- ASSERT_EQ(CalDAVStatus.Prefix, ConnNormal.Prefix);
- ASSERT_EQ(CalDAVStatus.UseSSL, ConnNormal.UseSSL);
+ ASSERT_EQ(calDAVStatus.hostname, connNormal.hostname);
+ ASSERT_EQ(calDAVStatus.username, connNormal.username);
+ ASSERT_EQ(calDAVStatus.port, connNormal.port);
+ ASSERT_EQ(calDAVStatus.prefix, connNormal.prefix);
+ ASSERT_EQ(calDAVStatus.useSSL, connNormal.useSSL);
// Connect to the server.
- CalDAVServerResult ConnResult = ServerConnection.Connect();
+ CalDAVServerResult connResult = serverConnection.Connect();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(200, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Check that the server supports CalDAV.
- CalDAVServerSupport ConnSupport = ServerConnection.GetServerSupport();
- ConnResult = ServerConnection.GetServerResult();
+ CalDAVServerSupport connSupport = serverConnection.GetServerSupport();
+ connResult = serverConnection.GetServerResult();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
- ASSERT_EQ(true, ConnSupport.BasicSupport);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(200, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
+ ASSERT_EQ(true, connSupport.basicSupport);
// Get the list of calendars.
- CalDAVCalendarList CalendarList = ServerConnection.GetCalendars();
+ CalDAVCalendarList calendarList = serverConnection.GetCalendars();
// Check the response result from the server.
- ConnResult = ServerConnection.GetServerResult();
+ connResult = serverConnection.GetServerResult();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(207, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(207, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Get the calendar with the matching name.
- int ItemSeek = 0;
- bool ItemFound = false;
+ int itemSeek = 0;
+ bool itemFound = false;
- for (map<int,string>::iterator CalendarNameIter = CalendarList.Name.begin();
- CalendarNameIter != CalendarList.Name.end(); CalendarNameIter++){
+ for (map<int,string>::iterator calendarNameIter = calendarList.name.begin();
+ calendarNameIter != calendarList.name.end(); calendarNameIter++){
- if (CalendarNameIter->second == "Calendar Edited Again"){
- ItemFound = true;
+ if (calendarNameIter->second == "Calendar Edited Again"){
+ itemFound = true;
break;
}
- ItemSeek++;
+ itemSeek++;
}
- ASSERT_NE(false, ItemFound);
+ ASSERT_NE(false, itemFound);
// Delete some calendars.
- string CalendarEditHREF = CalendarList.HREF[ItemSeek];
+ string calendarEditHREF = calendarList.href[itemSeek];
- ConnResult = ServerConnection.DeleteCalendar(&CalendarEditHREF);
+ connResult = serverConnection.DeleteCalendar(&calendarEditHREF);
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(204, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(204, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
}
TEST(CalDAV, AddEntry){
- CalDAVConnectionData ConnNormal;
- string CurrentUserPrincipal;
+ CalDAVConnectionData connNormal;
+ string currentUserPrincipal;
- bool ValidDataNormal = false;
+ bool validDataNormal = false;
// Attempt to read the caldavtest.auth file.
- ProcessConnectionDataFileResult DataFileResult = ProcessConnectionDataFile("caldavtest.auth", &ConnNormal);
- if (DataFileResult == PROCESSCONNECTIONDATAFILE_OK){
- ValidDataNormal = true;
+ ProcessConnectionDataFileResult dataFileResult = ProcessConnectionDataFile("caldavtest.auth", &connNormal);
+ if (dataFileResult == PROCESSCONNECTIONDATAFILE_OK){
+ validDataNormal = true;
}
- ASSERT_EQ(true, ValidDataNormal);
+ ASSERT_EQ(true, validDataNormal);
// Setup the connection.
- CalDAV ServerConnection;
+ CalDAV serverConnection;
- ServerConnection.SetupConnectionData(&ConnNormal);
+ serverConnection.SetupConnectionData(&connNormal);
// Verify the connection settings.
- CalDAVStatus CalDAVStatus = ServerConnection.GetConnectionData();
+ CalDAVStatus calDAVStatus = serverConnection.GetConnectionData();
- ASSERT_EQ(CalDAVStatus.Hostname, ConnNormal.Hostname);
- ASSERT_EQ(CalDAVStatus.Username, ConnNormal.Username);
- ASSERT_EQ(CalDAVStatus.Port, ConnNormal.Port);
- ASSERT_EQ(CalDAVStatus.Prefix, ConnNormal.Prefix);
- ASSERT_EQ(CalDAVStatus.UseSSL, ConnNormal.UseSSL);
+ ASSERT_EQ(calDAVStatus.hostname, connNormal.hostname);
+ ASSERT_EQ(calDAVStatus.username, connNormal.username);
+ ASSERT_EQ(calDAVStatus.port, connNormal.port);
+ ASSERT_EQ(calDAVStatus.prefix, connNormal.prefix);
+ ASSERT_EQ(calDAVStatus.useSSL, connNormal.useSSL);
// Connect to the server.
- CalDAVServerResult ConnResult = ServerConnection.Connect();
+ CalDAVServerResult connResult = serverConnection.Connect();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(200, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Check that the server supports CalDAV.
- CalDAVServerSupport ConnSupport = ServerConnection.GetServerSupport();
- ConnResult = ServerConnection.GetServerResult();
+ CalDAVServerSupport connSupport = serverConnection.GetServerSupport();
+ connResult = serverConnection.GetServerResult();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
- ASSERT_EQ(true, ConnSupport.BasicSupport);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(200, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
+ ASSERT_EQ(true, connSupport.basicSupport);
// Get the list of calendars.
- CalDAVCalendarList CalendarList = ServerConnection.GetCalendars();
+ CalDAVCalendarList calendarList = serverConnection.GetCalendars();
// Check the response result from the server.
- ConnResult = ServerConnection.GetServerResult();
+ connResult = serverConnection.GetServerResult();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(207, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(207, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Get the calendar with the matching name.
- int ItemSeek = 0;
- bool ItemFound = false;
+ int itemSeek = 0;
+ bool itemFound = false;
- for (map<int,string>::iterator CalendarNameIter = CalendarList.Name.begin();
- CalendarNameIter != CalendarList.Name.end(); CalendarNameIter++){
+ for (map<int,string>::iterator calendarNameIter = calendarList.name.begin();
+ calendarNameIter != calendarList.Name.end(); calendarNameIter++){
- if (CalendarNameIter->second == "Scratching Calendar"){
- ItemFound = true;
+ if (calendarNameIter->second == "Scratching Calendar"){
+ itemFound = true;
break;
}
- ItemSeek++;
+ itemSeek++;
}
- ASSERT_NE(false, ItemFound);
+ ASSERT_NE(false, itemFound);
- string EntryAddHREF = CalendarList.HREF[ItemSeek];
+ string entryAddHREF = calendarList.href[itemSeek];
- EntryUUID = GenerateUUID();
- EntryUUID.erase(EntryUUID.end()-1);
+ entryUUID = GenerateUUID();
+ entryUUID.erase(entryUUID.end()-1);
- EntryAddHREF.append(EntryUUID);
- EntryAddHREF.append(".ics");
+ entryAddHREF.append(entryUUID);
+ entryAddHREF.append(".ics");
- string AddEntryData = "BEGIN:VCALENDAR\n"
+ string addEntryData = "BEGIN:VCALENDAR\n"
"VERSION:2.0\n"
"PRODID:-//Xestia//Calendar Unit Testing//KW\n"
"BEGIN:VEVENT\n"
"UID:";
- AddEntryData += EntryUUID;
- AddEntryData += "\n"
+ addEntryData += entryUUID;
+ addEntryData += "\n"
"DTSTAMP:20160116T190200Z\n"
"DTSTART:20160116T190200Z\n"
"DTEND:20160116T190200Z\n"
"END:VEVENT\n"
"END:VCALENDAR\n";
- ConnResult = ServerConnection.AddEntry(&EntryAddHREF, &AddEntryData);
+ connResult = serverConnection.AddEntry(&entryAddHREF, &addEntryData);
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(201, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(201, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Set the EntryCalendarHREFProcessing for later on.
- EntryCalendarHREFProcessing = EntryAddHREF;
+ entryCalendarHREFProcessing = entryAddHREF;
}
TEST(CalDAV, GetEntryETag){
- CalDAVConnectionData ConnNormal;
- string CurrentUserPrincipal;
+ CalDAVConnectionData connNormal;
+ string currentUserPrincipal;
- bool ValidDataNormal = false;
+ bool validDataNormal = false;
// Attempt to read the caldavtest.auth file.
- ProcessConnectionDataFileResult DataFileResult = ProcessConnectionDataFile("caldavtest.auth", &ConnNormal);
- if (DataFileResult == PROCESSCONNECTIONDATAFILE_OK){
- ValidDataNormal = true;
+ ProcessConnectionDataFileResult dataFileResult = ProcessConnectionDataFile("caldavtest.auth", &connNormal);
+ if (dataFileResult == PROCESSCONNECTIONDATAFILE_OK){
+ validDataNormal = true;
}
- ASSERT_EQ(true, ValidDataNormal);
+ ASSERT_EQ(true, validDataNormal);
// Setup the connection.
- CalDAV ServerConnection;
+ CalDAV serverConnection;
- ServerConnection.SetupConnectionData(&ConnNormal);
+ serverConnection.SetupConnectionData(&connNormal);
// Verify the connection settings.
- CalDAVStatus CalDAVStatus = ServerConnection.GetConnectionData();
+ CalDAVStatus calDAVStatus = serverConnection.GetConnectionData();
- ASSERT_EQ(CalDAVStatus.Hostname, ConnNormal.Hostname);
- ASSERT_EQ(CalDAVStatus.Username, ConnNormal.Username);
- ASSERT_EQ(CalDAVStatus.Port, ConnNormal.Port);
- ASSERT_EQ(CalDAVStatus.Prefix, ConnNormal.Prefix);
- ASSERT_EQ(CalDAVStatus.UseSSL, ConnNormal.UseSSL);
+ ASSERT_EQ(calDAVStatus.hostname, connNormal.hostname);
+ ASSERT_EQ(calDAVStatus.username, connNormal.username);
+ ASSERT_EQ(calDAVStatus.port, connNormal.port);
+ ASSERT_EQ(calDAVStatus.prefix, connNormal.prefix);
+ ASSERT_EQ(calDAVStatus.useSSL, connNormal.useSSL);
// Connect to the server.
- CalDAVServerResult ConnResult = ServerConnection.Connect();
+ CalDAVServerResult connResult = ServerConnection.Connect();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(200, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Check that the server supports CalDAV.
- CalDAVServerSupport ConnSupport = ServerConnection.GetServerSupport();
- ConnResult = ServerConnection.GetServerResult();
+ CalDAVServerSupport connSupport = serverConnection.GetServerSupport();
+ connResult = serverConnection.GetServerResult();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
- ASSERT_EQ(true, ConnSupport.BasicSupport);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(200, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
+ ASSERT_EQ(true, connSupport.basicSupport);
// Get the list of calendars.
- CalDAVCalendarList CalendarList = ServerConnection.GetCalendars();
+ CalDAVCalendarList calendarList = serverConnection.GetCalendars();
// Check the response result from the server.
- ConnResult = ServerConnection.GetServerResult();
+ connResult = serverConnection.GetServerResult();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(207, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(207, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Get the entry entity tag.
- string ETagValue;
+ string eTagValue;
- ConnResult = ServerConnection.GetEntryETag(&EntryCalendarHREFProcessing, &ETagValue);
+ connResult = serverConnection.GetEntryETag(&entryCalendarHREFProcessing, &eTagValue);
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(207, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(207, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
}
// Check that EntryCalendarHREFProcessing is not blank.
- ASSERT_NE("", EntryCalendarHREFProcessing);
+ ASSERT_NE("", entryCalendarHREFProcessing);
- CalDAVConnectionData ConnNormal;
- string CurrentUserPrincipal;
+ CalDAVConnectionData connNormal;
+ string currentUserPrincipal;
- bool ValidDataNormal = false;
+ bool validDataNormal = false;
// Attempt to read the caldavtest.auth file.
- ProcessConnectionDataFileResult DataFileResult = ProcessConnectionDataFile("caldavtest.auth", &ConnNormal);
- if (DataFileResult == PROCESSCONNECTIONDATAFILE_OK){
- ValidDataNormal = true;
+ ProcessConnectionDataFileResult dataFileResult = ProcessConnectionDataFile("caldavtest.auth", &connNormal);
+ if (dataFileResult == PROCESSCONNECTIONDATAFILE_OK){
+ validDataNormal = true;
}
- ASSERT_EQ(true, ValidDataNormal);
+ ASSERT_EQ(true, validDataNormal);
// Setup the connection.
- CalDAV ServerConnection;
+ CalDAV serverConnection;
- ServerConnection.SetupConnectionData(&ConnNormal);
+ serverConnection.SetupConnectionData(&connNormal);
// Verify the connection settings.
- CalDAVStatus CalDAVStatus = ServerConnection.GetConnectionData();
+ CalDAVStatus calDAVStatus = serverConnection.GetConnectionData();
- ASSERT_EQ(CalDAVStatus.Hostname, ConnNormal.Hostname);
- ASSERT_EQ(CalDAVStatus.Username, ConnNormal.Username);
- ASSERT_EQ(CalDAVStatus.Port, ConnNormal.Port);
- ASSERT_EQ(CalDAVStatus.Prefix, ConnNormal.Prefix);
- ASSERT_EQ(CalDAVStatus.UseSSL, ConnNormal.UseSSL);
+ ASSERT_EQ(calDAVStatus.hostname, connNormal.hostname);
+ ASSERT_EQ(calDAVStatus.username, connNormal.username);
+ ASSERT_EQ(calDAVStatus.port, connNormal.port);
+ ASSERT_EQ(calDAVStatus.prefix, connNormal.prefix);
+ ASSERT_EQ(calDAVStatus.useSSL, connNormal.useSSL);
// Connect to the server.
- CalDAVServerResult ConnResult = ServerConnection.Connect();
+ CalDAVServerResult connResult = serverConnection.Connect();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(200, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Check that the server supports CalDAV.
- CalDAVServerSupport ConnSupport = ServerConnection.GetServerSupport();
- ConnResult = ServerConnection.GetServerResult();
+ CalDAVServerSupport connSupport = serverConnection.GetServerSupport();
+ connResult = serverConnection.GetServerResult();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
- ASSERT_EQ(true, ConnSupport.BasicSupport);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(200, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
+ ASSERT_EQ(true, connSupport.basicSupport);
// Get the list of calendars.
- CalDAVCalendarList CalendarList = ServerConnection.GetCalendars();
+ CalDAVCalendarList calendarList = serverConnection.GetCalendars();
// Check the response result from the server.
- ConnResult = ServerConnection.GetServerResult();
+ connResult = serverConnection.GetServerResult();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(207, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(207, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Get the entry entity tag.
- string ETagValue;
+ string eTagValue;
- ConnResult = ServerConnection.GetEntryETag(&EntryCalendarHREFProcessing, &ETagValue);
+ connResult = serverConnection.GetEntryETag(&entryCalendarHREFProcessing, &eTagValue);
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(207, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(207, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Update the contact with new information.
- string EditEntryData = "BEGIN:VCALENDAR\n"
+ string editEntryData = "BEGIN:VCALENDAR\n"
"VERSION:2.0\n"
"PRODID:-//Xestia//Calendar Unit Testing//KW\n"
"BEGIN:VEVENT\n"
"UID:";
- EditEntryData += EntryUUID;
- EditEntryData += "\n"
+ editEntryData += entryUUID;
+ editEntryData += "\n"
"DTSTAMP:20160116T190200Z\n"
"DTSTART:20160116T190200Z\n"
"DTEND:20160116T190200Z\n"
"END:VEVENT\n"
"END:VCALENDAR\n";
- ConnResult = ServerConnection.EditEntry(&EntryCalendarHREFProcessing, &EditEntryData, &ETagValue);
+ connResult = serverConnection.EditEntry(&entryCalendarHREFProcessing, &editEntryData, &eTagValue);
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(204, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(204, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
}
// Check that EntryCalendarHREFProcessing is not blank.
- ASSERT_NE("", EntryCalendarHREFProcessing);
+ ASSERT_NE("", entryCalendarHREFProcessing);
- CalDAVConnectionData ConnNormal;
- string CurrentUserPrincipal;
+ CalDAVConnectionData connNormal;
+ string currentUserPrincipal;
- bool ValidDataNormal = false;
+ bool validDataNormal = false;
// Attempt to read the caldavtest.auth file.
- ProcessConnectionDataFileResult DataFileResult = ProcessConnectionDataFile("caldavtest.auth", &ConnNormal);
- if (DataFileResult == PROCESSCONNECTIONDATAFILE_OK){
- ValidDataNormal = true;
+ ProcessConnectionDataFileResult dataFileResult = ProcessConnectionDataFile("caldavtest.auth", &connNormal);
+ if (dataFileResult == PROCESSCONNECTIONDATAFILE_OK){
+ validDataNormal = true;
}
- ASSERT_EQ(true, ValidDataNormal);
+ ASSERT_EQ(true, validDataNormal);
// Setup the connection.
- CalDAV ServerConnection;
+ CalDAV serverConnection;
- ServerConnection.SetupConnectionData(&ConnNormal);
+ serverConnection.SetupConnectionData(&connNormal);
// Verify the connection settings.
- CalDAVStatus CalDAVStatus = ServerConnection.GetConnectionData();
+ CalDAVStatus calDAVStatus = serverConnection.GetConnectionData();
- ASSERT_EQ(CalDAVStatus.Hostname, ConnNormal.Hostname);
- ASSERT_EQ(CalDAVStatus.Username, ConnNormal.Username);
- ASSERT_EQ(CalDAVStatus.Port, ConnNormal.Port);
- ASSERT_EQ(CalDAVStatus.Prefix, ConnNormal.Prefix);
- ASSERT_EQ(CalDAVStatus.UseSSL, ConnNormal.UseSSL);
+ ASSERT_EQ(calDAVStatus.hostname, connNormal.hostname);
+ ASSERT_EQ(calDAVStatus.username, connNormal.username);
+ ASSERT_EQ(calDAVStatus.port, connNormal.port);
+ ASSERT_EQ(calDAVStatus.prefix, connNormal.prefix);
+ ASSERT_EQ(calDAVStatus.useSSL, connNormal.useSSL);
// Connect to the server.
- CalDAVServerResult ConnResult = ServerConnection.Connect();
+ CalDAVServerResult connResult = serverConnection.Connect();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(200, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Check that the server supports CalDAV.
- CalDAVServerSupport ConnSupport = ServerConnection.GetServerSupport();
- ConnResult = ServerConnection.GetServerResult();
+ CalDAVServerSupport connSupport = serverConnection.GetServerSupport();
+ connResult = serverConnection.GetServerResult();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
- ASSERT_EQ(true, ConnSupport.BasicSupport);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(200, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
+ ASSERT_EQ(true, connSupport.basicSupport);
// Delete the calendar entry.
- ConnResult = ServerConnection.DeleteCalendar(&EntryCalendarHREFProcessing);
+ connResult = serverConnection.DeleteCalendar(&entryCalendarHREFProcessing);
// Check the response result from the server.
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(204, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(204, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
}
// Check that EntryCalendarHREFProcessing is not blank.
- ASSERT_NE("", EntryCalendarHREFProcessing);
+ ASSERT_NE("", entryCalendarHREFProcessing);
- CalDAVConnectionData ConnNormal;
- string CurrentUserPrincipal;
+ CalDAVConnectionData connNormal;
+ string currentUserPrincipal;
- bool ValidDataNormal = false;
+ bool validDataNormal = false;
// Attempt to read the caldavtest.auth file.
- ProcessConnectionDataFileResult DataFileResult = ProcessConnectionDataFile("caldavtest.auth", &ConnNormal);
- if (DataFileResult == PROCESSCONNECTIONDATAFILE_OK){
- ValidDataNormal = true;
+ ProcessConnectionDataFileResult dataFileResult = ProcessConnectionDataFile("caldavtest.auth", &connNormal);
+ if (dataFileResult == PROCESSCONNECTIONDATAFILE_OK){
+ validDataNormal = true;
}
- ASSERT_EQ(true, ValidDataNormal);
+ ASSERT_EQ(true, validDataNormal);
// Setup the connection.
- CalDAV ServerConnection;
+ CalDAV serverConnection;
- ServerConnection.SetupConnectionData(&ConnNormal);
+ serverConnection.SetupConnectionData(&connNormal);
// Verify the connection settings.
- CalDAVStatus CalDAVStatus = ServerConnection.GetConnectionData();
+ CalDAVStatus calDAVStatus = serverConnection.GetConnectionData();
- ASSERT_EQ(CalDAVStatus.Hostname, ConnNormal.Hostname);
- ASSERT_EQ(CalDAVStatus.Username, ConnNormal.Username);
- ASSERT_EQ(CalDAVStatus.Port, ConnNormal.Port);
- ASSERT_EQ(CalDAVStatus.Prefix, ConnNormal.Prefix);
- ASSERT_EQ(CalDAVStatus.UseSSL, ConnNormal.UseSSL);
+ ASSERT_EQ(calDAVStatus.hostname, connNormal.hostname);
+ ASSERT_EQ(calDAVStatus.username, connNormal.username);
+ ASSERT_EQ(calDAVStatus.port, connNormal.port);
+ ASSERT_EQ(calDAVStatus.prefix, connNormal.prefix);
+ ASSERT_EQ(calDAVStatus.useSSL, connNormal.useSSL);
// Connect to the server.
- CalDAVServerResult ConnResult = ServerConnection.Connect();
+ CalDAVServerResult connResult = serverConnection.Connect();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(200, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
// Check that the server supports CalDAV.
- CalDAVServerSupport ConnSupport = ServerConnection.GetServerSupport();
- ConnResult = ServerConnection.GetServerResult();
+ CalDAVServerSupport connSupport = serverConnection.GetServerSupport();
+ connResult = serverConnection.GetServerResult();
- EXPECT_EQ(CALDAVQUERYRESULT_OK, ConnResult.Result);
- ASSERT_EQ(200, ConnResult.HTTPCode);
- ASSERT_EQ(CURLE_OK, ConnResult.Code);
- ASSERT_EQ(true, ConnSupport.BasicSupport);
+ EXPECT_EQ(CALDAVQUERYRESULT_OK, connResult.result);
+ ASSERT_EQ(200, connResult.httpCode);
+ ASSERT_EQ(CURLE_OK, connResult.code);
+ ASSERT_EQ(true, connSupport.basicSupport);
// Get the user principal.
- string UserPrincipalURI = ServerConnection.GetUserPrincipal();
+ string userPrincipalURI = serverConnection.GetUserPrincipal();
// Get the calendar home.
- string CalendarHomeURL = ServerConnection.GetCalendarHome(UserPrincipalURI);
+ string calendarHomeURL = serverConnection.GetCalendarHome(userPrincipalURI);
- string CalendarHREF = CalendarHomeURL;
- CalendarHREF += "unittestcal/";
+ string calendarHREF = calendarHomeURL;
+ calendarHREF += "unittestcal/";
// Get the entry list without a calendar tag set.
- CalDAVEntryList EntryList = ServerConnection.GetEntryList(&CalendarHREF);
+ CalDAVEntryList entryList = serverConnection.GetEntryList(&calendarHREF);
- EXPECT_GE(EntryList.HREF.size(), 1);
+ EXPECT_GE(entryList.href.size(), 1);
// Get the list of calendars.
- CalDAVCalendarList CalendarList = ServerConnection.GetCalendars();
+ CalDAVCalendarList calendarList = serverConnection.GetCalendars();
- string CalendarTagURL = "";
+ string calendarTagURL = "";
- for (std::map<int,string>::iterator CalHREFIter = CalendarList.HREF.begin();
- CalHREFIter != CalendarList.HREF.end(); CalHREFIter++){
+ for (std::map<int,string>::iterator calHREFIter = calendarList.href.begin();
+ calHREFIter != calendarList.HREF.end(); calHREFIter++){
- if (CalHREFIter->second.substr(CalHREFIter->second.length() - 13) == "/unittestcal/"){
+ if (calHREFIter->second.substr(calHREFIter->second.length() - 13) == "/unittestcal/"){
- CalendarTagURL = CalendarList.TagURL.find(CalHREFIter->first)->second;
+ calendarTagURL = calendarList.tagURL.find(calHREFIter->first)->second;
}
// Get the entry list without a calendar tag set (shouldn't be empty).
- EntryList = ServerConnection.GetEntryList(&CalendarHREF, nullptr);
+ entryList = serverConnection.GetEntryList(&calendarHREF, nullptr);
- EXPECT_GE(EntryList.HREF.size(), 1);
+ EXPECT_GE(entryList.href.size(), 1);
// Get the entry list with a calendar tag set (should be empty).
- EntryList = ServerConnection.GetEntryList(&CalendarHREF, &CalendarTagURL);
+ entryList = serverConnection.GetEntryList(&calendarHREF, &calendarTagURL);
- EXPECT_EQ(EntryList.HREF.size(), 0);
+ EXPECT_EQ(entryList.href.size(), 0);
}
\ No newline at end of file
#include "../libraries/CalendarDataStorage/CalendarDataStorage.h"
-Colour DefaultColour;
+Colour defaultColour;
TEST(CalendarDataStorage, Setup_Tables){
- CalendarDataStorage SetupTablesTest;
+ CalendarDataStorage setupTablesTest;
- ASSERT_EQ(true, SetupTablesTest.DidInitOK());
+ ASSERT_EQ(true, setupTablesTest.DidInitOK());
}
TEST(CalendarDataStorage, Add_One_Account){
- CalendarDataStorage AddOneEntryTest;
+ CalendarDataStorage addOneEntryTest;
- ASSERT_EQ(CDSACCOUNT_OK, AddOneEntryTest.AddAccount("Test Account 1", 1));
+ ASSERT_EQ(CDSACCOUNT_OK, addOneEntryTest.AddAccount("Test Account 1", 1));
}
TEST(CalendarDataStorage, Add_Two_Accounts){
- CalendarDataStorage AddTwoEntryTest;
+ CalendarDataStorage addTwoEntryTest;
- ASSERT_EQ(CDSACCOUNT_OK, AddTwoEntryTest.AddAccount("Test Account 1", 1));
- ASSERT_EQ(CDSACCOUNT_OK, AddTwoEntryTest.AddAccount("Test Account 2", 2));
+ ASSERT_EQ(CDSACCOUNT_OK, addTwoEntryTest.AddAccount("Test Account 1", 1));
+ ASSERT_EQ(CDSACCOUNT_OK, addTwoEntryTest.AddAccount("Test Account 2", 2));
}
TEST(CalendarDataStorage, Add_Three_Accounts){
- CalendarDataStorage AddThreeEntryTest;
+ CalendarDataStorage addThreeEntryTest;
- 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));
+ 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));
}
TEST(CalendarDataStorage, Get_Account_Information){
- CalendarDataStorage AccountInformationTest;
+ CalendarDataStorage accountInformationTest;
- 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);
+ 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);
}
TEST(CalendarDataStorage, Get_Two_Accounts_Information){
- CalendarDataStorage AccountInformationTest;
+ CalendarDataStorage accountInformationTest;
- AccountInformationTest.AddAccount("Test Account 1", 1);
- AccountInformationTest.AddAccount("Test Account 2", 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 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 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);
}
TEST(CalendarDataStorage, Get_Three_Accounts_Information){
- CalendarDataStorage AccountInformationTest;
+ CalendarDataStorage accountInformationTest;
- AccountInformationTest.AddAccount("Test Account 1", 1);
- AccountInformationTest.AddAccount("Test Account 2", 2);
- AccountInformationTest.AddAccount("Test Account 3", 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 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 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);
+ 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);
}
TEST(CalendarDataStorage, Get_List_Of_One_Account){
- CalendarDataStorage AccountInformationTest;
+ CalendarDataStorage accountInformationTest;
- AccountInformationTest.AddAccount("Test Account 1", 1);
+ accountInformationTest.AddAccount("Test Account 1", 1);
- CDSAccountList accountListData = AccountInformationTest.GetAccountList();
+ CDSAccountList accountListData = accountInformationTest.GetAccountList();
ASSERT_EQ(1, accountListData.accountList.size());
ASSERT_EQ(CDSACCOUNT_OK, accountListData.getAccountListResult);
TEST(CalendarDataStorage, Get_List_Of_Two_Accounts){
- CalendarDataStorage AccountInformationTest;
+ CalendarDataStorage accountInformationTest;
- AccountInformationTest.AddAccount("Test Account 1", 1);
- AccountInformationTest.AddAccount("Test Account 2", 2);
+ accountInformationTest.AddAccount("Test Account 1", 1);
+ accountInformationTest.AddAccount("Test Account 2", 2);
- CDSAccountList accountListData = AccountInformationTest.GetAccountList();
+ CDSAccountList accountListData = accountInformationTest.GetAccountList();
ASSERT_EQ(2, accountListData.accountList.size());
ASSERT_EQ(CDSACCOUNT_OK, accountListData.getAccountListResult);
TEST(CalendarDataStorage, Get_List_Of_Three_Accounts){
- CalendarDataStorage AccountInformationTest;
+ CalendarDataStorage accountInformationTest;
- AccountInformationTest.AddAccount("Test Account 1", 1);
- AccountInformationTest.AddAccount("Test Account 2", 2);
- AccountInformationTest.AddAccount("Test Account 3", 3);
+ accountInformationTest.AddAccount("Test Account 1", 1);
+ accountInformationTest.AddAccount("Test Account 2", 2);
+ accountInformationTest.AddAccount("Test Account 3", 3);
- CDSAccountList accountListData = AccountInformationTest.GetAccountList();
+ CDSAccountList accountListData = accountInformationTest.GetAccountList();
ASSERT_EQ(3, accountListData.accountList.size());
ASSERT_EQ(CDSACCOUNT_OK, accountListData.getAccountListResult);
TEST(CalendarDataStorage, Update_One_Account){
- CalendarDataStorage UpdateAccountTest;
+ CalendarDataStorage updateAccountTest;
- UpdateAccountTest.AddAccount("Test Account 1", 1);
+ updateAccountTest.AddAccount("Test Account 1", 1);
- int testAccount1ID = UpdateAccountTest.GetAccount("Test Account 1").accountID;
+ int testAccount1ID = updateAccountTest.GetAccount("Test Account 1").accountID;
EXPECT_EQ(1, testAccount1ID);
- ASSERT_EQ(CDSACCOUNT_OK, UpdateAccountTest.UpdateAccount(testAccount1ID, "Test Account 1 - Updated"));
- ASSERT_NE(CDSACCOUNT_OK, UpdateAccountTest.GetAccount("Test Account 1").accountInfoResult);
- ASSERT_EQ(CDSACCOUNT_OK, UpdateAccountTest.GetAccount("Test Account 1 - Updated").accountInfoResult);
+ ASSERT_EQ(CDSACCOUNT_OK, updateAccountTest.UpdateAccount(testAccount1ID, "Test Account 1 - Updated"));
+ ASSERT_NE(CDSACCOUNT_OK, updateAccountTest.GetAccount("Test Account 1").accountInfoResult);
+ ASSERT_EQ(CDSACCOUNT_OK, updateAccountTest.GetAccount("Test Account 1 - Updated").accountInfoResult);
}
TEST(CalendarDataStorage, Update_Two_Accounts){
- CalendarDataStorage UpdateAccountTest;
+ CalendarDataStorage updateAccountTest;
- UpdateAccountTest.AddAccount("Test Account 1", 1);
- UpdateAccountTest.AddAccount("Test Account 2", 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;
+ int testAccount1ID = updateAccountTest.GetAccount("Test Account 1").accountID;
+ int testAccount2ID = updateAccountTest.GetAccount("Test Account 2").accountID;
EXPECT_EQ(1, testAccount1ID);
EXPECT_EQ(2, testAccount2ID);
- ASSERT_EQ(CDSACCOUNT_OK, UpdateAccountTest.UpdateAccount(testAccount1ID, "Test Account 1 - Updated"));
- ASSERT_EQ(CDSACCOUNT_OK, UpdateAccountTest.UpdateAccount(testAccount2ID, "Test Account 2 - Updated"));
+ ASSERT_EQ(CDSACCOUNT_OK, updateAccountTest.UpdateAccount(testAccount1ID, "Test Account 1 - Updated"));
+ ASSERT_EQ(CDSACCOUNT_OK, updateAccountTest.UpdateAccount(testAccount2ID, "Test Account 2 - Updated"));
- ASSERT_NE(CDSACCOUNT_OK, UpdateAccountTest.GetAccount("Test Account 1").accountInfoResult);
- ASSERT_EQ(CDSACCOUNT_OK, UpdateAccountTest.GetAccount("Test Account 1 - Updated").accountInfoResult);
+ ASSERT_NE(CDSACCOUNT_OK, updateAccountTest.GetAccount("Test Account 1").accountInfoResult);
+ ASSERT_EQ(CDSACCOUNT_OK, updateAccountTest.GetAccount("Test Account 1 - Updated").accountInfoResult);
- ASSERT_NE(CDSACCOUNT_OK, UpdateAccountTest.GetAccount("Test Account 2").accountInfoResult);
- ASSERT_EQ(CDSACCOUNT_OK, UpdateAccountTest.GetAccount("Test Account 2 - Updated").accountInfoResult);
+ ASSERT_NE(CDSACCOUNT_OK, updateAccountTest.GetAccount("Test Account 2").accountInfoResult);
+ ASSERT_EQ(CDSACCOUNT_OK, updateAccountTest.GetAccount("Test Account 2 - Updated").accountInfoResult);
}
TEST(CalendarDataStorage, Update_Three_Accounts){
- CalendarDataStorage UpdateAccountTest;
+ CalendarDataStorage updateAccountTest;
- UpdateAccountTest.AddAccount("Test Account 1", 1);
- UpdateAccountTest.AddAccount("Test Account 2", 2);
- UpdateAccountTest.AddAccount("Test Account 3", 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;
- int testAccount3ID = UpdateAccountTest.GetAccount("Test Account 3").accountID;
+ int testAccount1ID = updateAccountTest.GetAccount("Test Account 1").accountID;
+ int testAccount2ID = updateAccountTest.GetAccount("Test Account 2").accountID;
+ int testAccount3ID = updateAccountTest.GetAccount("Test Account 3").accountID;
EXPECT_EQ(1, testAccount1ID);
EXPECT_EQ(2, testAccount2ID);
EXPECT_EQ(3, testAccount3ID);
- ASSERT_EQ(CDSACCOUNT_OK, UpdateAccountTest.UpdateAccount(testAccount1ID, "Test Account 1 - Updated"));
- ASSERT_EQ(CDSACCOUNT_OK, UpdateAccountTest.UpdateAccount(testAccount2ID, "Test Account 2 - Updated"));
- ASSERT_EQ(CDSACCOUNT_OK, UpdateAccountTest.UpdateAccount(testAccount3ID, "Test Account 3 - Updated"));
+ ASSERT_EQ(CDSACCOUNT_OK, updateAccountTest.UpdateAccount(testAccount1ID, "Test Account 1 - Updated"));
+ ASSERT_EQ(CDSACCOUNT_OK, updateAccountTest.UpdateAccount(testAccount2ID, "Test Account 2 - Updated"));
+ ASSERT_EQ(CDSACCOUNT_OK, updateAccountTest.UpdateAccount(testAccount3ID, "Test Account 3 - Updated"));
- ASSERT_NE(CDSACCOUNT_OK, UpdateAccountTest.GetAccount("Test Account 1").accountInfoResult);
- ASSERT_EQ(CDSACCOUNT_OK, UpdateAccountTest.GetAccount("Test Account 1 - Updated").accountInfoResult);
+ ASSERT_NE(CDSACCOUNT_OK, updateAccountTest.GetAccount("Test Account 1").accountInfoResult);
+ ASSERT_EQ(CDSACCOUNT_OK, updateAccountTest.GetAccount("Test Account 1 - Updated").accountInfoResult);
- ASSERT_NE(CDSACCOUNT_OK, UpdateAccountTest.GetAccount("Test Account 2").accountInfoResult);
- ASSERT_EQ(CDSACCOUNT_OK, UpdateAccountTest.GetAccount("Test Account 2 - Updated").accountInfoResult);
+ ASSERT_NE(CDSACCOUNT_OK, updateAccountTest.GetAccount("Test Account 2").accountInfoResult);
+ ASSERT_EQ(CDSACCOUNT_OK, updateAccountTest.GetAccount("Test Account 2 - Updated").accountInfoResult);
- ASSERT_NE(CDSACCOUNT_OK, UpdateAccountTest.GetAccount("Test Account 3").accountInfoResult);
- ASSERT_EQ(CDSACCOUNT_OK, UpdateAccountTest.GetAccount("Test Account 3 - Updated").accountInfoResult);
+ ASSERT_NE(CDSACCOUNT_OK, updateAccountTest.GetAccount("Test Account 3").accountInfoResult);
+ ASSERT_EQ(CDSACCOUNT_OK, updateAccountTest.GetAccount("Test Account 3 - Updated").accountInfoResult);
}
TEST(CalendarDataStorage, Delete_One_Account){
- CalendarDataStorage DeleteAccountTest;
+ CalendarDataStorage deleteAccountTest;
- DeleteAccountTest.AddAccount("Test Account 1", 1);
+ deleteAccountTest.AddAccount("Test Account 1", 1);
- ASSERT_EQ(CDSACCOUNT_OK, DeleteAccountTest.DeleteAccount(DeleteAccountTest.GetAccount("Test Account 1").accountID));
+ ASSERT_EQ(CDSACCOUNT_OK, deleteAccountTest.DeleteAccount(deleteAccountTest.GetAccount("Test Account 1").accountID));
}
TEST(CalendarDataStorage, Delete_Two_Accounts){
- CalendarDataStorage DeleteAccountTest;
+ CalendarDataStorage deleteAccountTest;
- DeleteAccountTest.AddAccount("Test Account 1", 1);
- DeleteAccountTest.AddAccount("Test Account 2", 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));
+ ASSERT_EQ(CDSACCOUNT_OK, deleteAccountTest.DeleteAccount(deleteAccountTest.GetAccount("Test Account 1").accountID));
+ ASSERT_EQ(CDSACCOUNT_OK, deleteAccountTest.DeleteAccount(deleteAccountTest.GetAccount("Test Account 2").accountID));
}
TEST(CalendarDataStorage, Delete_Three_Accounts){
- CalendarDataStorage DeleteAccountTest;
+ CalendarDataStorage deleteAccountTest;
- DeleteAccountTest.AddAccount("Test Account 1", 1);
- DeleteAccountTest.AddAccount("Test Account 2", 2);
- DeleteAccountTest.AddAccount("Test Account 3", 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));
- ASSERT_EQ(CDSACCOUNT_OK, DeleteAccountTest.DeleteAccount(DeleteAccountTest.GetAccount("Test Account 3").accountID));
+ ASSERT_EQ(CDSACCOUNT_OK, deleteAccountTest.DeleteAccount(deleteAccountTest.GetAccount("Test Account 1").accountID));
+ ASSERT_EQ(CDSACCOUNT_OK, deleteAccountTest.DeleteAccount(deleteAccountTest.GetAccount("Test Account 2").accountID));
+ ASSERT_EQ(CDSACCOUNT_OK, deleteAccountTest.DeleteAccount(deleteAccountTest.GetAccount("Test Account 3").accountID));
}
TEST(CalendarDataStorage, Add_One_Calendar_To_One_Account){
- CalendarDataStorage AddCalendarTest;
+ CalendarDataStorage addCalendarTest;
- AddCalendarTest.AddAccount("Test Account 1", 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 1", "calendar1-test", defaultColour, "Calendar Description"));
}
TEST(CalendarDataStorage, Add_Two_Calendars_To_One_Account){
- CalendarDataStorage AddCalendarTest;
+ CalendarDataStorage addCalendarTest;
- AddCalendarTest.AddAccount("Test Account 1", 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"));
+ 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"));
}
TEST(CalendarDataStorage, Add_Three_Calendars_To_One_Account){
- CalendarDataStorage AddCalendarTest;
+ CalendarDataStorage addCalendarTest;
- AddCalendarTest.AddAccount("Test Account 1", 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"));
- 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 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"));
}
TEST(CalendarDataStorage, Add_One_Calendar_To_Two_Accounts){
- CalendarDataStorage AddCalendarTest;
+ CalendarDataStorage addCalendarTest;
- AddCalendarTest.AddAccount("Test Account 1", 1);
- AddCalendarTest.AddAccount("Test Account 2", 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 1", "calendar1-test", defaultColour, "Calendar Description"));
- 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 1", "calendar1-test", defaultColour, "Calendar Description"));
}
TEST(CalendarDataStorage, Add_Two_Calendars_To_Two_Accounts){
- CalendarDataStorage AddCalendarTest;
+ CalendarDataStorage addCalendarTest;
- AddCalendarTest.AddAccount("Test Account 1", 1);
- AddCalendarTest.AddAccount("Test Account 2", 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"));
+ 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, "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 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"));
}
TEST(CalendarDataStorage, Add_Three_Calendars_To_Two_Accounts){
- CalendarDataStorage AddCalendarTest;
+ CalendarDataStorage addCalendarTest;
- AddCalendarTest.AddAccount("Test Account 1", 1);
- AddCalendarTest.AddAccount("Test Account 2", 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"));
- 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 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, "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 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"));
}
TEST(CalendarDataStorage, Add_One_Calendar_To_Three_Accounts){
- CalendarDataStorage AddCalendarTest;
+ CalendarDataStorage addCalendarTest;
- AddCalendarTest.AddAccount("Test Account 1", 1);
- AddCalendarTest.AddAccount("Test Account 2", 2);
- AddCalendarTest.AddAccount("Test Account 3", 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 1", "calendar1-test", defaultColour, "Calendar Description"));
- 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 1", "calendar1-test", defaultColour, "Calendar Description"));
- 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 1", "calendar1-test", defaultColour, "Calendar Description"));
}
TEST(CalendarDataStorage, Add_Two_Calendars_To_Three_Accounts){
- CalendarDataStorage AddCalendarTest;
+ CalendarDataStorage addCalendarTest;
- AddCalendarTest.AddAccount("Test Account 1", 1);
- AddCalendarTest.AddAccount("Test Account 2", 2);
- AddCalendarTest.AddAccount("Test Account 3", 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"));
+ 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, "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 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, "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 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"));
}
TEST(CalendarDataStorage, Add_Three_Calendars_To_Three_Accounts){
- CalendarDataStorage AddCalendarTest;
+ CalendarDataStorage addCalendarTest;
- AddCalendarTest.AddAccount("Test Account 1", 1);
- AddCalendarTest.AddAccount("Test Account 2", 2);
- AddCalendarTest.AddAccount("Test Account 3", 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"));
- 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 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, "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 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, "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"));
+ 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"));
}
TEST(CalendarDataStorage, Get_Calendar_Information_From_One_Account){
- CalendarDataStorage GetCalendarTest;
+ CalendarDataStorage getCalendarTest;
- GetCalendarTest.AddAccount("Test Account 1", 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"));
- 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 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;
CDSGetCalendarInfo calendar3Info;
- calendar1Info = GetCalendarTest.GetCalendar("Test Account 1", "calendar1-test");
- calendar2Info = GetCalendarTest.GetCalendar("Test Account 1", "calendar2-test");
- calendar3Info = GetCalendarTest.GetCalendar("Test Account 1", "calendar3-test");
+ calendar1Info = getCalendarTest.GetCalendar("Test Account 1", "calendar1-test");
+ calendar2Info = getCalendarTest.GetCalendar("Test Account 1", "calendar2-test");
+ calendar3Info = getCalendarTest.GetCalendar("Test Account 1", "calendar3-test");
ASSERT_EQ(CDSCALENDAR_OK, calendar1Info.calendarInfoResult);
ASSERT_EQ(CDSCALENDAR_OK, calendar2Info.calendarInfoResult);
TEST(CalendarDataStorage, Get_Calendar_Information_From_Two_Accounts){
- CalendarDataStorage GetCalendarTest;
+ CalendarDataStorage getCalendarTest;
- GetCalendarTest.AddAccount("Test Account 1", 1);
- GetCalendarTest.AddAccount("Test Account 2", 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"));
- 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 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, "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 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;
CDSGetCalendarInfo calendar5Info;
CDSGetCalendarInfo calendar6Info;
- calendar1Info = GetCalendarTest.GetCalendar("Test Account 1", "calendar1-test");
- calendar2Info = GetCalendarTest.GetCalendar("Test Account 1", "calendar2-test");
- calendar3Info = GetCalendarTest.GetCalendar("Test Account 1", "calendar3-test");
+ calendar1Info = getCalendarTest.GetCalendar("Test Account 1", "calendar1-test");
+ calendar2Info = getCalendarTest.GetCalendar("Test Account 1", "calendar2-test");
+ calendar3Info = getCalendarTest.GetCalendar("Test Account 1", "calendar3-test");
- calendar4Info = GetCalendarTest.GetCalendar("Test Account 2", "calendar1-test");
- calendar5Info = GetCalendarTest.GetCalendar("Test Account 2", "calendar2-test");
- calendar6Info = GetCalendarTest.GetCalendar("Test Account 2", "calendar3-test");
+ calendar4Info = getCalendarTest.GetCalendar("Test Account 2", "calendar1-test");
+ calendar5Info = getCalendarTest.GetCalendar("Test Account 2", "calendar2-test");
+ calendar6Info = getCalendarTest.GetCalendar("Test Account 2", "calendar3-test");
ASSERT_EQ(CDSCALENDAR_OK, calendar1Info.calendarInfoResult);
ASSERT_EQ(CDSCALENDAR_OK, calendar2Info.calendarInfoResult);
TEST(CalendarDataStorage, Get_Calendar_Information_From_Three_Accounts){
- CalendarDataStorage GetCalendarTest;
+ CalendarDataStorage getCalendarTest;
- GetCalendarTest.AddAccount("Test Account 1", 1);
- GetCalendarTest.AddAccount("Test Account 2", 2);
- GetCalendarTest.AddAccount("Test Account 3", 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"));
- 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 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, "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 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, "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"));
+ 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;
CDSGetCalendarInfo calendar8Info;
CDSGetCalendarInfo calendar9Info;
- calendar1Info = GetCalendarTest.GetCalendar("Test Account 1", "calendar1-test");
- calendar2Info = GetCalendarTest.GetCalendar("Test Account 1", "calendar2-test");
- calendar3Info = GetCalendarTest.GetCalendar("Test Account 1", "calendar3-test");
+ calendar1Info = getCalendarTest.GetCalendar("Test Account 1", "calendar1-test");
+ calendar2Info = getCalendarTest.GetCalendar("Test Account 1", "calendar2-test");
+ calendar3Info = getCalendarTest.GetCalendar("Test Account 1", "calendar3-test");
- calendar4Info = GetCalendarTest.GetCalendar("Test Account 2", "calendar1-test");
- calendar5Info = GetCalendarTest.GetCalendar("Test Account 2", "calendar2-test");
- calendar6Info = GetCalendarTest.GetCalendar("Test Account 2", "calendar3-test");
+ calendar4Info = getCalendarTest.GetCalendar("Test Account 2", "calendar1-test");
+ calendar5Info = getCalendarTest.GetCalendar("Test Account 2", "calendar2-test");
+ calendar6Info = getCalendarTest.GetCalendar("Test Account 2", "calendar3-test");
- calendar7Info = GetCalendarTest.GetCalendar("Test Account 3", "calendar1-test");
- calendar8Info = GetCalendarTest.GetCalendar("Test Account 3", "calendar2-test");
- calendar9Info = GetCalendarTest.GetCalendar("Test Account 3", "calendar3-test");
+ calendar7Info = getCalendarTest.GetCalendar("Test Account 3", "calendar1-test");
+ calendar8Info = getCalendarTest.GetCalendar("Test Account 3", "calendar2-test");
+ calendar9Info = getCalendarTest.GetCalendar("Test Account 3", "calendar3-test");
ASSERT_EQ(CDSCALENDAR_OK, calendar1Info.calendarInfoResult);
ASSERT_EQ(CDSCALENDAR_OK, calendar2Info.calendarInfoResult);
TEST(CalendarDataStorage, Update_One_Calendar_With_One_Account){
- CalendarDataStorage UpdateCalendarTest;
+ CalendarDataStorage updateCalendarTest;
- UpdateCalendarTest.AddAccount("Test Account 1", 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 1", "calendar1-test", defaultColour, "Calendar Description 1"));
- CDSGetCalendarInfo calendar1Info = UpdateCalendarTest.GetCalendar("Test Account 1", "calendar1-test");
+ CDSGetCalendarInfo calendar1Info = updateCalendarTest.GetCalendar("Test Account 1", "calendar1-test");
- 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);
+ 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);
}
TEST(CalendarDataStorage, Update_One_Calendar_With_Two_Accounts){
- CalendarDataStorage UpdateCalendarTest;
+ CalendarDataStorage updateCalendarTest;
- UpdateCalendarTest.AddAccount("Test Account 1", 1);
- UpdateCalendarTest.AddAccount("Test Account 2", 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"));
+ 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");
+ 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", 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(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 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);
+ 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);
}
TEST(CalendarDataStorage, Update_One_Calendar_With_Three_Accounts){
- CalendarDataStorage UpdateCalendarTest;
+ CalendarDataStorage updateCalendarTest;
- UpdateCalendarTest.AddAccount("Test Account 1", 1);
- UpdateCalendarTest.AddAccount("Test Account 2", 2);
- UpdateCalendarTest.AddAccount("Test Account 3", 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"));
- ASSERT_EQ(CDSCALENDAR_OK, UpdateCalendarTest.AddCalendar(UpdateCalendarTest.GetAccount("Test Account 3").accountID, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 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"));
+ 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");
+ 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", 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(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 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);
+ 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){
- CalendarDataStorage UpdateCalendarTest;
+ CalendarDataStorage updateCalendarTest;
- UpdateCalendarTest.AddAccount("Test Account 1", 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"));
+ 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");
+ 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", 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(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 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);
+ 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);
}
TEST(CalendarDataStorage, Update_Two_Calendars_With_Two_Accounts){
- CalendarDataStorage UpdateCalendarTest;
+ CalendarDataStorage updateCalendarTest;
- UpdateCalendarTest.AddAccount("Test Account 1", 1);
- UpdateCalendarTest.AddAccount("Test Account 2", 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"));
- 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 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");
+ 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", 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(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 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);
+ 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){
- CalendarDataStorage UpdateCalendarTest;
+ CalendarDataStorage updateCalendarTest;
- UpdateCalendarTest.AddAccount("Test Account 1", 1);
- UpdateCalendarTest.AddAccount("Test Account 2", 2);
- UpdateCalendarTest.AddAccount("Test Account 3", 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"));
- 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"));
+ 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");
- CDSGetCalendarInfo calendar3Info = UpdateCalendarTest.GetCalendar("Test Account 2", "calendar1-test");
- CDSGetCalendarInfo calendar4Info = UpdateCalendarTest.GetCalendar("Test Account 2", "calendar2-test");
- CDSGetCalendarInfo calendar5Info = UpdateCalendarTest.GetCalendar("Test Account 3", "calendar1-test");
- CDSGetCalendarInfo calendar6Info = UpdateCalendarTest.GetCalendar("Test Account 3", "calendar2-test");
+ 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");
+ 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", 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(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);
- 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 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 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 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);
+ 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);
}
TEST(CalendarDataStorage, Update_Three_Calendars_With_One_Account){
- CalendarDataStorage UpdateCalendarTest;
+ CalendarDataStorage updateCalendarTest;
- UpdateCalendarTest.AddAccount("Test Account 1", 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"));
- 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 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");
+ 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", 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(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 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);
+ 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){
- CalendarDataStorage UpdateCalendarTest;
+ CalendarDataStorage updateCalendarTest;
- UpdateCalendarTest.AddAccount("Test Account 1", 1);
- UpdateCalendarTest.AddAccount("Test Account 2", 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"));
- 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 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");
- CDSGetCalendarInfo calendar3Info = UpdateCalendarTest.GetCalendar("Test Account 1", "calendar3-test");
- CDSGetCalendarInfo calendar4Info = UpdateCalendarTest.GetCalendar("Test Account 2", "calendar1-test");
- CDSGetCalendarInfo calendar5Info = UpdateCalendarTest.GetCalendar("Test Account 2", "calendar2-test");
- CDSGetCalendarInfo calendar6Info = UpdateCalendarTest.GetCalendar("Test Account 2", "calendar3-test");
+ 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");
+ CDSGetCalendarInfo calendar4Info = updateCalendarTest.GetCalendar("Test Account 2", "calendar1-test");
+ 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", 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(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);
- ASSERT_EQ("Calendar 3 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar3-test").calendarName);
- ASSERT_EQ("Calendar 4 Updated", UpdateCalendarTest.GetCalendar("Test Account 2", "calendar1-test").calendarName);
- 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 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 4 Updated", updateCalendarTest.GetCalendar("Test Account 2", "calendar1-test").calendarName);
+ 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);
+ 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){
- CalendarDataStorage UpdateCalendarTest;
-
- 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"));
- 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");
- CDSGetCalendarInfo calendar3Info = UpdateCalendarTest.GetCalendar("Test Account 1", "calendar3-test");
- CDSGetCalendarInfo calendar4Info = UpdateCalendarTest.GetCalendar("Test Account 2", "calendar1-test");
- CDSGetCalendarInfo calendar5Info = UpdateCalendarTest.GetCalendar("Test Account 2", "calendar2-test");
- CDSGetCalendarInfo calendar6Info = UpdateCalendarTest.GetCalendar("Test Account 2", "calendar3-test");
- CDSGetCalendarInfo calendar7Info = UpdateCalendarTest.GetCalendar("Test Account 3", "calendar1-test");
- 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", 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);
- ASSERT_EQ("Calendar 3 Updated", UpdateCalendarTest.GetCalendar("Test Account 1", "calendar3-test").calendarName);
- ASSERT_EQ("Calendar 4 Updated", UpdateCalendarTest.GetCalendar("Test Account 2", "calendar1-test").calendarName);
- 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 7 Updated", UpdateCalendarTest.GetCalendar("Test Account 3", "calendar1-test").calendarName);
- 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);
+ CalendarDataStorage updateCalendarTest;
+
+ 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"));
+ 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");
+ CDSGetCalendarInfo calendar3Info = updateCalendarTest.GetCalendar("Test Account 1", "calendar3-test");
+ CDSGetCalendarInfo calendar4Info = updateCalendarTest.GetCalendar("Test Account 2", "calendar1-test");
+ CDSGetCalendarInfo calendar5Info = updateCalendarTest.GetCalendar("Test Account 2", "calendar2-test");
+ CDSGetCalendarInfo calendar6Info = updateCalendarTest.GetCalendar("Test Account 2", "calendar3-test");
+ CDSGetCalendarInfo calendar7Info = updateCalendarTest.GetCalendar("Test Account 3", "calendar1-test");
+ 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", 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);
+ ASSERT_EQ("Calendar 3 Updated", updateCalendarTest.GetCalendar("Test Account 1", "calendar3-test").calendarName);
+ ASSERT_EQ("Calendar 4 Updated", updateCalendarTest.GetCalendar("Test Account 2", "calendar1-test").calendarName);
+ 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 7 Updated", updateCalendarTest.GetCalendar("Test Account 3", "calendar1-test").calendarName);
+ 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){
- CalendarDataStorage DeleteCalendarTest;
+ CalendarDataStorage deleteCalendarTest;
int calendarID = 0;
- DeleteCalendarTest.AddAccount("Test Account 1", 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"));
+ 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;
+ calendarID = deleteCalendarTest.GetCalendar(deleteCalendarTest.GetAccount("Test Account 1").accountName, "calendar1-test").calendarID;
- ASSERT_EQ(CDSCALENDAR_OK, DeleteCalendarTest.DeleteCalendar(calendarID));
+ ASSERT_EQ(CDSCALENDAR_OK, deleteCalendarTest.DeleteCalendar(calendarID));
}
TEST(CalendarDataStorage, Delete_Two_Calendars){
- CalendarDataStorage DeleteCalendarTest;
+ CalendarDataStorage deleteCalendarTest;
int calendarID1 = 0;
int calendarID2 = 0;
- DeleteCalendarTest.AddAccount("Test Account 1", 1);
- DeleteCalendarTest.AddAccount("Test Account 2", 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"));
+ 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;
+ calendarID1 = deleteCalendarTest.GetCalendar(deleteCalendarTest.GetAccount("Test Account 1").accountName, "calendar1-test").calendarID;
+ calendarID2 = deleteCalendarTest.GetCalendar(deleteCalendarTest.GetAccount("Test Account 1").accountName, "calendar2-test").calendarID;
- ASSERT_EQ(CDSCALENDAR_OK, DeleteCalendarTest.DeleteCalendar(calendarID1));
- ASSERT_EQ(CDSCALENDAR_OK, DeleteCalendarTest.DeleteCalendar(calendarID2));
+ ASSERT_EQ(CDSCALENDAR_OK, deleteCalendarTest.DeleteCalendar(calendarID1));
+ ASSERT_EQ(CDSCALENDAR_OK, deleteCalendarTest.DeleteCalendar(calendarID2));
}
TEST(CalendarDataStorage, Delete_Three_Calendars){
- CalendarDataStorage DeleteCalendarTest;
+ CalendarDataStorage deleteCalendarTest;
int calendarID1 = 0;
int calendarID2 = 0;
int calendarID3 = 0;
- DeleteCalendarTest.AddAccount("Test Account 1", 1);
- DeleteCalendarTest.AddAccount("Test Account 2", 2);
- DeleteCalendarTest.AddAccount("Test Account 3", 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"));
- ASSERT_EQ(CDSCALENDAR_OK, DeleteCalendarTest.AddCalendar(DeleteCalendarTest.GetAccount("Test Account 1").accountID, "Calendar 3", "calendar3-test", DefaultColour, "Calendar Description 1"));
+ 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;
- calendarID3 = DeleteCalendarTest.GetCalendar(DeleteCalendarTest.GetAccount("Test Account 1").accountName, "calendar3-test").calendarID;
+ calendarID1 = deleteCalendarTest.GetCalendar(deleteCalendarTest.GetAccount("Test Account 1").accountName, "calendar1-test").calendarID;
+ calendarID2 = deleteCalendarTest.GetCalendar(deleteCalendarTest.GetAccount("Test Account 1").accountName, "calendar2-test").calendarID;
+ calendarID3 = deleteCalendarTest.GetCalendar(deleteCalendarTest.GetAccount("Test Account 1").accountName, "calendar3-test").calendarID;
- ASSERT_EQ(CDSCALENDAR_OK, DeleteCalendarTest.DeleteCalendar(calendarID1));
- ASSERT_EQ(CDSCALENDAR_OK, DeleteCalendarTest.DeleteCalendar(calendarID2));
- ASSERT_EQ(CDSCALENDAR_OK, DeleteCalendarTest.DeleteCalendar(calendarID3));
+ ASSERT_EQ(CDSCALENDAR_OK, deleteCalendarTest.DeleteCalendar(calendarID1));
+ ASSERT_EQ(CDSCALENDAR_OK, deleteCalendarTest.DeleteCalendar(calendarID2));
+ ASSERT_EQ(CDSCALENDAR_OK, deleteCalendarTest.DeleteCalendar(calendarID3));
}
TEST(CalendarDataStorage, Add_One_Event){
- CalendarDataStorage AddEventTest;
+ CalendarDataStorage addEventTest;
- AddEventTest.AddAccount("Test Account 1", 1);
- AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 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");
+ CDSAddEntryResult addEventResult = addEventTest.AddEvent(1, "CalendarEvent1.ics");
ASSERT_EQ(CDSENTRY_OK, addEventResult.addEventResult);
ASSERT_EQ(1, addEventResult.calendarEntryID);
TEST(CalendarDataStorage, Add_Two_Events){
- CalendarDataStorage AddEventTest;
+ CalendarDataStorage addEventTest;
- AddEventTest.AddAccount("Test Account 1", 1);
- AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 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 addEvent1Result = addEventTest.AddEvent(1, "CalendarEvent1.ics");
ASSERT_EQ(CDSENTRY_OK, addEvent1Result.addEventResult);
ASSERT_EQ(1, addEvent1Result.calendarEntryID);
- CDSAddEntryResult addEvent2Result = AddEventTest.AddEvent(1, "CalendarEvent1.ics");
+ CDSAddEntryResult addEvent2Result = addEventTest.AddEvent(1, "CalendarEvent1.ics");
ASSERT_EQ(CDSENTRY_OK, addEvent2Result.addEventResult);
ASSERT_EQ(2, addEvent2Result.calendarEntryID);
TEST(CalendarDataStorage, Add_Three_Events){
- CalendarDataStorage AddEventTest;
+ CalendarDataStorage addEventTest;
- AddEventTest.AddAccount("Test Account 1", 1);
- AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 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 addEvent1Result = addEventTest.AddEvent(1, "CalendarEvent1.ics");
ASSERT_EQ(CDSENTRY_OK, addEvent1Result.addEventResult);
ASSERT_EQ(1, addEvent1Result.calendarEntryID);
- CDSAddEntryResult addEvent2Result = AddEventTest.AddEvent(1, "CalendarEvent1.ics");
+ CDSAddEntryResult addEvent2Result = addEventTest.AddEvent(1, "CalendarEvent1.ics");
ASSERT_EQ(CDSENTRY_OK, addEvent2Result.addEventResult);
ASSERT_EQ(2, addEvent2Result.calendarEntryID);
- CDSAddEntryResult addEvent3Result = AddEventTest.AddEvent(1, "CalendarEvent1.ics");
+ CDSAddEntryResult addEvent3Result = addEventTest.AddEvent(1, "CalendarEvent1.ics");
ASSERT_EQ(CDSENTRY_OK, addEvent3Result.addEventResult);
ASSERT_EQ(3, addEvent3Result.calendarEntryID);
TEST(CalendarDataStorage, Add_One_Event_And_Get_Event_Basic_Information){
- CalendarDataStorage AddEventTest;
+ CalendarDataStorage addEventTest;
- AddEventTest.AddAccount("Test Account 1", 1);
- AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1");
- CDSAddEntryResult addEventResult = AddEventTest.AddEvent(1, "CalendarEvent1.ics");
+ addEventTest.AddAccount("Test Account 1", 1);
+ addEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", defaultColour, "Calendar Description 1");
+ CDSAddEntryResult addEventResult = addEventTest.AddEvent(1, "CalendarEvent1.ics");
// Get the entry information.
- CDSGetCalendarEntryInfo entryInfo = AddEventTest.GetEvent(addEventResult.calendarEntryID);
+ CDSGetCalendarEntryInfo entryInfo = addEventTest.GetEvent(addEventResult.calendarEntryID);
ASSERT_EQ(CDSENTRY_OK, entryInfo.getEventResult);
ASSERT_EQ("First test event", entryInfo.entryName);
TEST(CalendarDataStorage, Add_One_Event_And_Get_Event_Basic_Information_With_Duration){
- CalendarDataStorage AddEventTest;
+ CalendarDataStorage addEventTest;
- AddEventTest.AddAccount("Test Account 1", 1);
- AddEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1");
- CDSAddEntryResult addEventResult = AddEventTest.AddEvent(1, "CalendarEvent2.ics");
+ addEventTest.AddAccount("Test Account 1", 1);
+ addEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", defaultColour, "Calendar Description 1");
+ CDSAddEntryResult addEventResult = addEventTest.AddEvent(1, "CalendarEvent2.ics");
EXPECT_EQ(CDSENTRY_OK, addEventResult.addEventResult);
// Get the entry information.
- CDSGetCalendarEntryInfo entryInfo = AddEventTest.GetEvent(addEventResult.calendarEntryID);
+ CDSGetCalendarEntryInfo entryInfo = addEventTest.GetEvent(addEventResult.calendarEntryID);
ASSERT_EQ(CDSENTRY_OK, entryInfo.getEventResult);
ASSERT_EQ("Second test event", entryInfo.entryName);
TEST(CalendarDataStorage, Add_Two_Events_And_Get_Event_Basic_Information){
- CalendarDataStorage AddEventTest;
+ CalendarDataStorage addEventTest;
- 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");
+ 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");
// Get the entry information.
- CDSGetCalendarEntryInfo entry1Info = AddEventTest.GetEvent(addEvent1Result.calendarEntryID);
+ CDSGetCalendarEntryInfo entry1Info = addEventTest.GetEvent(addEvent1Result.calendarEntryID);
ASSERT_EQ(CDSENTRY_OK, entry1Info.getEventResult);
ASSERT_EQ(CDSENTRY_OK, entry1Info.getEventResult);
ASSERT_EQ(30, entry1Info.entryEndMinute);
ASSERT_EQ(0, entry1Info.entryEndSecond);
- CDSGetCalendarEntryInfo entry2Info = AddEventTest.GetEvent(addEvent2Result.calendarEntryID);
+ CDSGetCalendarEntryInfo entry2Info = addEventTest.GetEvent(addEvent2Result.calendarEntryID);
ASSERT_EQ(CDSENTRY_OK, entry2Info.getEventResult);
ASSERT_EQ(CDSENTRY_OK, entry2Info.getEventResult);
TEST(CalendarDataStorage, Add_The_Same_Three_Events_And_Get_Event_Information){
- CalendarDataStorage AddEventTest;
+ CalendarDataStorage addEventTest;
- 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");
- CDSAddEntryResult addEvent3Result = AddEventTest.AddEvent(1, "CalendarEvent1.ics");
+ 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");
+ CDSAddEntryResult addEvent3Result = addEventTest.AddEvent(1, "CalendarEvent1.ics");
// Get the entry information.
- CDSGetCalendarEntryInfo entry1Info = AddEventTest.GetEvent(addEvent1Result.calendarEntryID);
+ CDSGetCalendarEntryInfo entry1Info = addEventTest.GetEvent(addEvent1Result.calendarEntryID);
ASSERT_EQ(CDSENTRY_OK, entry1Info.getEventResult);
ASSERT_EQ(CDSENTRY_OK, entry1Info.getEventResult);
ASSERT_EQ(30, entry1Info.entryEndMinute);
ASSERT_EQ(0, entry1Info.entryEndSecond);
- CDSGetCalendarEntryInfo entry2Info = AddEventTest.GetEvent(addEvent2Result.calendarEntryID);
+ CDSGetCalendarEntryInfo entry2Info = addEventTest.GetEvent(addEvent2Result.calendarEntryID);
ASSERT_EQ(CDSENTRY_OK, entry2Info.getEventResult);
ASSERT_EQ(CDSENTRY_OK, entry2Info.getEventResult);
ASSERT_EQ(30, entry2Info.entryEndMinute);
ASSERT_EQ(0, entry2Info.entryEndSecond);
- CDSGetCalendarEntryInfo entry3Info = AddEventTest.GetEvent(addEvent3Result.calendarEntryID);
+ CDSGetCalendarEntryInfo entry3Info = addEventTest.GetEvent(addEvent3Result.calendarEntryID);
ASSERT_EQ(CDSENTRY_OK, entry3Info.getEventResult);
ASSERT_EQ(CDSENTRY_OK, entry3Info.getEventResult);
TEST(CalendarDataStorage, Add_Three_Events_And_Get_Event_Information){
- CalendarDataStorage AddEventTest;
+ CalendarDataStorage addEventTest;
- 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");
- CDSAddEntryResult addEvent3Result = AddEventTest.AddEvent(1, "CalendarEvent3.ics");
+ 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");
+ CDSAddEntryResult addEvent3Result = addEventTest.AddEvent(1, "CalendarEvent3.ics");
// Get the entry information.
- CDSGetCalendarEntryInfo entry1Info = AddEventTest.GetEvent(addEvent1Result.calendarEntryID);
+ CDSGetCalendarEntryInfo entry1Info = addEventTest.GetEvent(addEvent1Result.calendarEntryID);
ASSERT_EQ(CDSENTRY_OK, entry1Info.getEventResult);
ASSERT_EQ(CDSENTRY_OK, entry1Info.getEventResult);
ASSERT_EQ(30, entry1Info.entryEndMinute);
ASSERT_EQ(0, entry1Info.entryEndSecond);
- CDSGetCalendarEntryInfo entry2Info = AddEventTest.GetEvent(addEvent2Result.calendarEntryID);
+ CDSGetCalendarEntryInfo entry2Info = addEventTest.GetEvent(addEvent2Result.calendarEntryID);
ASSERT_EQ(CDSENTRY_OK, entry2Info.getEventResult);
ASSERT_EQ(CDSENTRY_OK, entry2Info.getEventResult);
ASSERT_EQ(30, entry2Info.entryDurationMinutes);
ASSERT_EQ(15, entry2Info.entryDurationSeconds);
- CDSGetCalendarEntryInfo entry3Info = AddEventTest.GetEvent(addEvent3Result.calendarEntryID);
+ CDSGetCalendarEntryInfo entry3Info = addEventTest.GetEvent(addEvent3Result.calendarEntryID);
ASSERT_EQ(CDSENTRY_OK, entry3Info.getEventResult);
ASSERT_EQ(CDSENTRY_OK, entry3Info.getEventResult);
TEST(CalendarDataStorage, Delete_One_Event){
- CalendarDataStorage DeleteEventTest;
+ CalendarDataStorage deleteEventTest;
- DeleteEventTest.AddAccount("Test Account 1", 1);
- DeleteEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1");
- CDSAddEntryResult addEventResult = DeleteEventTest.AddEvent(1, "CalendarEvent1.ics");
+ deleteEventTest.AddAccount("Test Account 1", 1);
+ deleteEventTest.AddCalendar(1, "Calendar 1", "calendar1-test", defaultColour, "Calendar Description 1");
+ CDSAddEntryResult addEventResult = deleteEventTest.AddEvent(1, "CalendarEvent1.ics");
EXPECT_EQ(CDSENTRY_OK, addEventResult.addEventResult);
- ASSERT_EQ(CDSENTRY_OK, DeleteEventTest.DeleteEvent(addEventResult.calendarEntryID));
+ ASSERT_EQ(CDSENTRY_OK, deleteEventTest.DeleteEvent(addEventResult.calendarEntryID));
}
TEST(CalendarDataStorage, Delete_Two_Events){
- CalendarDataStorage DeleteEventTest;
+ CalendarDataStorage deleteEventTest;
- 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");
+ 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");
EXPECT_EQ(CDSENTRY_OK, addEvent1Result.addEventResult);
EXPECT_EQ(CDSENTRY_OK, addEvent2Result.addEventResult);
- ASSERT_EQ(CDSENTRY_OK, DeleteEventTest.DeleteEvent(addEvent1Result.calendarEntryID));
- ASSERT_EQ(CDSENTRY_OK, DeleteEventTest.DeleteEvent(addEvent2Result.calendarEntryID));
+ ASSERT_EQ(CDSENTRY_OK, deleteEventTest.DeleteEvent(addEvent1Result.calendarEntryID));
+ ASSERT_EQ(CDSENTRY_OK, deleteEventTest.DeleteEvent(addEvent2Result.calendarEntryID));
}
TEST(CalendarDataStorage, Delete_Three_Events){
- CalendarDataStorage DeleteEventTest;
+ CalendarDataStorage deleteEventTest;
- 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");
- CDSAddEntryResult addEvent3Result = DeleteEventTest.AddEvent(1, "CalendarEvent3.ics");
+ 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");
+ CDSAddEntryResult addEvent3Result = deleteEventTest.AddEvent(1, "CalendarEvent3.ics");
EXPECT_EQ(CDSENTRY_OK, addEvent1Result.addEventResult);
EXPECT_EQ(CDSENTRY_OK, addEvent2Result.addEventResult);
EXPECT_EQ(CDSENTRY_OK, addEvent3Result.addEventResult);
- ASSERT_EQ(CDSENTRY_OK, DeleteEventTest.DeleteEvent(addEvent1Result.calendarEntryID));
- ASSERT_EQ(CDSENTRY_OK, DeleteEventTest.DeleteEvent(addEvent2Result.calendarEntryID));
- ASSERT_EQ(CDSENTRY_OK, DeleteEventTest.DeleteEvent(addEvent3Result.calendarEntryID));
+ ASSERT_EQ(CDSENTRY_OK, deleteEventTest.DeleteEvent(addEvent1Result.calendarEntryID));
+ ASSERT_EQ(CDSENTRY_OK, deleteEventTest.DeleteEvent(addEvent2Result.calendarEntryID));
+ ASSERT_EQ(CDSENTRY_OK, deleteEventTest.DeleteEvent(addEvent3Result.calendarEntryID));
}
TEST(CalendarDataStorage, Delete_One_Calendar_And_Events){
- CalendarDataStorage DeleteEventTest;
+ CalendarDataStorage deleteEventTest;
- 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");
- CDSAddEntryResult addEvent3Result = DeleteEventTest.AddEvent(1, "CalendarEvent3.ics");
+ 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");
+ CDSAddEntryResult addEvent3Result = deleteEventTest.AddEvent(1, "CalendarEvent3.ics");
- EXPECT_EQ(CDSCALENDAR_OK, DeleteEventTest.DeleteCalendar(1));
+ EXPECT_EQ(CDSCALENDAR_OK, deleteEventTest.DeleteCalendar(1));
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteEventTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteEventTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteEventTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteEventTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteEventTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteEventTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
}
TEST(CalendarDataStorage, Delete_Two_Calendars_And_Events){
- CalendarDataStorage DeleteEventTest;
+ CalendarDataStorage deleteEventTest;
- 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");
+ 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");
// Setup and delete the first calendar.
- CDSAddEntryResult addEvent1Result = DeleteEventTest.AddEvent(1, "CalendarEvent1.ics");
- CDSAddEntryResult addEvent2Result = DeleteEventTest.AddEvent(1, "CalendarEvent2.ics");
- CDSAddEntryResult addEvent3Result = DeleteEventTest.AddEvent(1, "CalendarEvent3.ics");
+ CDSAddEntryResult addEvent1Result = deleteEventTest.AddEvent(1, "CalendarEvent1.ics");
+ CDSAddEntryResult addEvent2Result = deleteEventTest.AddEvent(1, "CalendarEvent2.ics");
+ CDSAddEntryResult addEvent3Result = deleteEventTest.AddEvent(1, "CalendarEvent3.ics");
- EXPECT_EQ(CDSCALENDAR_OK, DeleteEventTest.DeleteCalendar(1));
+ EXPECT_EQ(CDSCALENDAR_OK, deleteEventTest.DeleteCalendar(1));
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteEventTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteEventTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteEventTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteEventTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteEventTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteEventTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
// Setup and delete the second calendar.
- addEvent1Result = DeleteEventTest.AddEvent(2, "CalendarEvent1.ics");
- addEvent2Result = DeleteEventTest.AddEvent(2, "CalendarEvent2.ics");
- addEvent3Result = DeleteEventTest.AddEvent(2, "CalendarEvent3.ics");
+ addEvent1Result = deleteEventTest.AddEvent(2, "CalendarEvent1.ics");
+ addEvent2Result = deleteEventTest.AddEvent(2, "CalendarEvent2.ics");
+ addEvent3Result = deleteEventTest.AddEvent(2, "CalendarEvent3.ics");
- EXPECT_EQ(CDSCALENDAR_OK, DeleteEventTest.DeleteCalendar(2));
+ EXPECT_EQ(CDSCALENDAR_OK, deleteEventTest.DeleteCalendar(2));
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteEventTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteEventTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteEventTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteEventTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteEventTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteEventTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
}
TEST(CalendarDataStorage, Delete_Three_Calendars_And_Events){
- CalendarDataStorage DeleteEventTest;
+ CalendarDataStorage deleteEventTest;
- 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");
+ 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");
// Setup and delete the first calendar.
- CDSAddEntryResult addEvent1Result = DeleteEventTest.AddEvent(1, "CalendarEvent1.ics");
- CDSAddEntryResult addEvent2Result = DeleteEventTest.AddEvent(1, "CalendarEvent2.ics");
- CDSAddEntryResult addEvent3Result = DeleteEventTest.AddEvent(1, "CalendarEvent3.ics");
+ CDSAddEntryResult addEvent1Result = deleteEventTest.AddEvent(1, "CalendarEvent1.ics");
+ CDSAddEntryResult addEvent2Result = deleteEventTest.AddEvent(1, "CalendarEvent2.ics");
+ CDSAddEntryResult addEvent3Result = deleteEventTest.AddEvent(1, "CalendarEvent3.ics");
- EXPECT_EQ(CDSCALENDAR_OK, DeleteEventTest.DeleteCalendar(1));
+ EXPECT_EQ(CDSCALENDAR_OK, deleteEventTest.DeleteCalendar(1));
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteEventTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteEventTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteEventTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteEventTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteEventTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteEventTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
// Setup and delete the second calendar.
- addEvent1Result = DeleteEventTest.AddEvent(2, "CalendarEvent1.ics");
- addEvent2Result = DeleteEventTest.AddEvent(2, "CalendarEvent2.ics");
- addEvent3Result = DeleteEventTest.AddEvent(2, "CalendarEvent3.ics");
+ addEvent1Result = deleteEventTest.AddEvent(2, "CalendarEvent1.ics");
+ addEvent2Result = deleteEventTest.AddEvent(2, "CalendarEvent2.ics");
+ addEvent3Result = deleteEventTest.AddEvent(2, "CalendarEvent3.ics");
- EXPECT_EQ(CDSCALENDAR_OK, DeleteEventTest.DeleteCalendar(2));
+ EXPECT_EQ(CDSCALENDAR_OK, deleteEventTest.DeleteCalendar(2));
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteEventTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteEventTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteEventTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteEventTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteEventTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteEventTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
// Setup and delete the third calendar.
- addEvent1Result = DeleteEventTest.AddEvent(3, "CalendarEvent1.ics");
- addEvent2Result = DeleteEventTest.AddEvent(3, "CalendarEvent2.ics");
- addEvent3Result = DeleteEventTest.AddEvent(3, "CalendarEvent3.ics");
+ addEvent1Result = deleteEventTest.AddEvent(3, "CalendarEvent1.ics");
+ addEvent2Result = deleteEventTest.AddEvent(3, "CalendarEvent2.ics");
+ addEvent3Result = deleteEventTest.AddEvent(3, "CalendarEvent3.ics");
- EXPECT_EQ(CDSCALENDAR_OK, DeleteEventTest.DeleteCalendar(3));
+ EXPECT_EQ(CDSCALENDAR_OK, deleteEventTest.DeleteCalendar(3));
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteEventTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteEventTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteEventTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteEventTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteEventTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteEventTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
}
TEST(CalendarDataStorage, Delete_One_Account_And_Associated_Data){
- CalendarDataStorage DeleteAccountTest;
+ CalendarDataStorage deleteAccountTest;
- DeleteAccountTest.AddAccount("Test Account 1", 1);
- DeleteAccountTest.AddCalendar(1, "Calendar 1", "calendar1-test", DefaultColour, "Calendar Description 1");
+ deleteAccountTest.AddAccount("Test Account 1", 1);
+ deleteAccountTest.AddCalendar(1, "Calendar 1", "calendar1-test", defaultColour, "Calendar Description 1");
// Setup and delete the first account.
- CDSAddEntryResult addEvent1Result = DeleteAccountTest.AddEvent(1, "CalendarEvent1.ics");
- CDSAddEntryResult addEvent2Result = DeleteAccountTest.AddEvent(1, "CalendarEvent2.ics");
- CDSAddEntryResult addEvent3Result = DeleteAccountTest.AddEvent(1, "CalendarEvent3.ics");
+ CDSAddEntryResult addEvent1Result = deleteAccountTest.AddEvent(1, "CalendarEvent1.ics");
+ CDSAddEntryResult addEvent2Result = deleteAccountTest.AddEvent(1, "CalendarEvent2.ics");
+ CDSAddEntryResult addEvent3Result = deleteAccountTest.AddEvent(1, "CalendarEvent3.ics");
- EXPECT_EQ(CDSCALENDAR_OK, DeleteAccountTest.DeleteAccount(1));
+ EXPECT_EQ(CDSCALENDAR_OK, deleteAccountTest.DeleteAccount(1));
- EXPECT_EQ(CDSENTRY_NOACCOUNT, DeleteAccountTest.GetCalendar("Test Account 1", "calendar1-test").calendarInfoResult);
+ EXPECT_EQ(CDSENTRY_NOACCOUNT, deleteAccountTest.GetCalendar("Test Account 1", "calendar1-test").calendarInfoResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteAccountTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteAccountTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteAccountTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteAccountTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteAccountTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteAccountTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
}
TEST(CalendarDataStorage, Delete_Two_Accounts_And_Associated_Data){
- CalendarDataStorage DeleteAccountTest;
+ CalendarDataStorage deleteAccountTest;
- DeleteAccountTest.AddAccount("Test Account 1", 1);
- DeleteAccountTest.AddAccount("Test Account 2", 2);
- DeleteAccountTest.AddAccount("Test Account 3", 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.
- 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");
+ 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");
- CDSAddEntryResult addEvent3Result = DeleteAccountTest.AddEvent(1, "CalendarEvent3.ics");
+ CDSAddEntryResult addEvent1Result = deleteAccountTest.AddEvent(1, "CalendarEvent1.ics");
+ CDSAddEntryResult addEvent2Result = deleteAccountTest.AddEvent(1, "CalendarEvent2.ics");
+ CDSAddEntryResult addEvent3Result = deleteAccountTest.AddEvent(1, "CalendarEvent3.ics");
- EXPECT_EQ(CDSCALENDAR_OK, DeleteAccountTest.DeleteAccount(1));
+ EXPECT_EQ(CDSCALENDAR_OK, deleteAccountTest.DeleteAccount(1));
- EXPECT_EQ(CDSENTRY_NOACCOUNT, DeleteAccountTest.GetCalendar("Test Account 1", "calendar1-test").calendarInfoResult);
+ EXPECT_EQ(CDSENTRY_NOACCOUNT, deleteAccountTest.GetCalendar("Test Account 1", "calendar1-test").calendarInfoResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteAccountTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteAccountTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteAccountTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteAccountTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteAccountTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteAccountTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
// Setup and delete the second account.
- 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");
+ 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");
- addEvent3Result = DeleteAccountTest.AddEvent(4, "CalendarEvent3.ics");
+ addEvent1Result = deleteAccountTest.AddEvent(4, "CalendarEvent1.ics");
+ addEvent2Result = deleteAccountTest.AddEvent(4, "CalendarEvent2.ics");
+ addEvent3Result = deleteAccountTest.AddEvent(4, "CalendarEvent3.ics");
- EXPECT_EQ(CDSCALENDAR_OK, DeleteAccountTest.DeleteAccount(2));
+ EXPECT_EQ(CDSCALENDAR_OK, deleteAccountTest.DeleteAccount(2));
- EXPECT_EQ(CDSENTRY_NOACCOUNT, DeleteAccountTest.GetCalendar("Test Account 2", "calendar1-test").calendarInfoResult);
+ EXPECT_EQ(CDSENTRY_NOACCOUNT, deleteAccountTest.GetCalendar("Test Account 2", "calendar1-test").calendarInfoResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteAccountTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteAccountTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteAccountTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteAccountTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteAccountTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteAccountTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
}
TEST(CalendarDataStorage, Delete_Three_Accounts_And_Associated_Data){
- CalendarDataStorage DeleteAccountTest;
+ CalendarDataStorage deleteAccountTest;
- DeleteAccountTest.AddAccount("Test Account 1", 1);
- DeleteAccountTest.AddAccount("Test Account 2", 2);
- DeleteAccountTest.AddAccount("Test Account 3", 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.
- 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");
+ 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");
- CDSAddEntryResult addEvent3Result = DeleteAccountTest.AddEvent(1, "CalendarEvent3.ics");
+ CDSAddEntryResult addEvent1Result = deleteAccountTest.AddEvent(1, "CalendarEvent1.ics");
+ CDSAddEntryResult addEvent2Result = deleteAccountTest.AddEvent(1, "CalendarEvent2.ics");
+ CDSAddEntryResult addEvent3Result = deleteAccountTest.AddEvent(1, "CalendarEvent3.ics");
- EXPECT_EQ(CDSCALENDAR_OK, DeleteAccountTest.DeleteAccount(1));
+ EXPECT_EQ(CDSCALENDAR_OK, deleteAccountTest.DeleteAccount(1));
- EXPECT_EQ(CDSENTRY_NOACCOUNT, DeleteAccountTest.GetCalendar("Test Account 1", "calendar1-test").calendarInfoResult);
+ EXPECT_EQ(CDSENTRY_NOACCOUNT, deleteAccountTest.GetCalendar("Test Account 1", "calendar1-test").calendarInfoResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteAccountTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteAccountTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteAccountTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteAccountTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteAccountTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteAccountTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
// Setup and delete the second account.
- 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");
+ 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");
- addEvent3Result = DeleteAccountTest.AddEvent(4, "CalendarEvent3.ics");
+ addEvent1Result = deleteAccountTest.AddEvent(4, "CalendarEvent1.ics");
+ addEvent2Result = deleteAccountTest.AddEvent(4, "CalendarEvent2.ics");
+ addEvent3Result = deleteAccountTest.AddEvent(4, "CalendarEvent3.ics");
- EXPECT_EQ(CDSCALENDAR_OK, DeleteAccountTest.DeleteAccount(2));
+ EXPECT_EQ(CDSCALENDAR_OK, deleteAccountTest.DeleteAccount(2));
- EXPECT_EQ(CDSENTRY_NOACCOUNT, DeleteAccountTest.GetCalendar("Test Account 2", "calendar1-test").calendarInfoResult);
+ EXPECT_EQ(CDSENTRY_NOACCOUNT, deleteAccountTest.GetCalendar("Test Account 2", "calendar1-test").calendarInfoResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteAccountTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteAccountTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteAccountTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteAccountTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteAccountTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteAccountTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
// Setup and delete the third account.
- 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");
+ 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");
- addEvent3Result = DeleteAccountTest.AddEvent(7, "CalendarEvent3.ics");
+ addEvent1Result = deleteAccountTest.AddEvent(7, "CalendarEvent1.ics");
+ addEvent2Result = deleteAccountTest.AddEvent(7, "CalendarEvent2.ics");
+ addEvent3Result = deleteAccountTest.AddEvent(7, "CalendarEvent3.ics");
- EXPECT_EQ(CDSCALENDAR_OK, DeleteAccountTest.DeleteAccount(3));
+ EXPECT_EQ(CDSCALENDAR_OK, deleteAccountTest.DeleteAccount(3));
- EXPECT_EQ(CDSENTRY_NOACCOUNT, DeleteAccountTest.GetCalendar("Test Account 3", "calendar1-test").calendarInfoResult);
+ EXPECT_EQ(CDSENTRY_NOACCOUNT, deleteAccountTest.GetCalendar("Test Account 3", "calendar1-test").calendarInfoResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteAccountTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteAccountTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
- EXPECT_EQ(CDSENTRY_NOENTRY, DeleteAccountTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteAccountTest.GetEvent(addEvent1Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteAccountTest.GetEvent(addEvent2Result.calendarEntryID).getEventResult);
+ EXPECT_EQ(CDSENTRY_NOENTRY, deleteAccountTest.GetEvent(addEvent3Result.calendarEntryID).getEventResult);
}
TEST(CalendarDataStorage, Get_List_Of_Events_For_One_Account){
- CalendarDataStorage GetEventsListTest;
+ CalendarDataStorage getEventsListTest;
- GetEventsListTest.AddAccount("Test Account 1", 1);
+ getEventsListTest.AddAccount("Test Account 1", 1);
// Setup and delete the first account.
- 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");
+ 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");
- CDSAddEntryResult addEvent3Result = GetEventsListTest.AddEvent(1, "CalendarEvent3.ics");
+ CDSAddEntryResult addEvent1Result = getEventsListTest.AddEvent(1, "CalendarEvent1.ics");
+ CDSAddEntryResult addEvent2Result = getEventsListTest.AddEvent(1, "CalendarEvent2.ics");
+ CDSAddEntryResult addEvent3Result = getEventsListTest.AddEvent(1, "CalendarEvent3.ics");
- CDSEntryList entryList = GetEventsListTest.GetEventList(1);
+ CDSEntryList entryList = getEventsListTest.GetEventList(1);
EXPECT_EQ(1, entryList.entryList.at(0));
EXPECT_EQ(2, entryList.entryList.at(1));
TEST(CalendarDataStorage, Get_List_Of_Events_For_Two_Accounts){
- CalendarDataStorage GetEventsListTest;
+ CalendarDataStorage getEventsListTest;
- GetEventsListTest.AddAccount("Test Account 1", 1);
+ getEventsListTest.AddAccount("Test Account 1", 1);
// Setup and delete the first account.
- 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");
+ 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.
- CDSAddEntryResult addEvent1Result = GetEventsListTest.AddEvent(1, "CalendarEvent1.ics");
- CDSAddEntryResult addEvent2Result = GetEventsListTest.AddEvent(1, "CalendarEvent2.ics");
- CDSAddEntryResult addEvent3Result = GetEventsListTest.AddEvent(1, "CalendarEvent3.ics");
+ CDSAddEntryResult addEvent1Result = getEventsListTest.AddEvent(1, "CalendarEvent1.ics");
+ CDSAddEntryResult addEvent2Result = getEventsListTest.AddEvent(1, "CalendarEvent2.ics");
+ CDSAddEntryResult addEvent3Result = getEventsListTest.AddEvent(1, "CalendarEvent3.ics");
- CDSEntryList entryList = GetEventsListTest.GetEventList(1);
+ CDSEntryList entryList = getEventsListTest.GetEventList(1);
EXPECT_EQ(1, entryList.entryList.at(0));
EXPECT_EQ(2, entryList.entryList.at(1));
// Setup the second account.
- addEvent1Result = GetEventsListTest.AddEvent(2, "CalendarEvent1.ics");
- addEvent2Result = GetEventsListTest.AddEvent(2, "CalendarEvent2.ics");
- addEvent3Result = GetEventsListTest.AddEvent(2, "CalendarEvent3.ics");
+ addEvent1Result = getEventsListTest.AddEvent(2, "CalendarEvent1.ics");
+ addEvent2Result = getEventsListTest.AddEvent(2, "CalendarEvent2.ics");
+ addEvent3Result = getEventsListTest.AddEvent(2, "CalendarEvent3.ics");
- entryList = GetEventsListTest.GetEventList(2);
+ entryList = getEventsListTest.GetEventList(2);
EXPECT_EQ(4, entryList.entryList.at(0));
EXPECT_EQ(5, entryList.entryList.at(1));
TEST(CalendarDataStorage, Get_List_Of_Events_For_Three_Accounts){
- CalendarDataStorage GetEventsListTest;
+ CalendarDataStorage getEventsListTest;
- GetEventsListTest.AddAccount("Test Account 1", 1);
+ getEventsListTest.AddAccount("Test Account 1", 1);
// Setup and delete the first account.
- 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");
+ 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.
- CDSAddEntryResult addEvent1Result = GetEventsListTest.AddEvent(1, "CalendarEvent1.ics");
- CDSAddEntryResult addEvent2Result = GetEventsListTest.AddEvent(1, "CalendarEvent2.ics");
- CDSAddEntryResult addEvent3Result = GetEventsListTest.AddEvent(1, "CalendarEvent3.ics");
+ CDSAddEntryResult addEvent1Result = getEventsListTest.AddEvent(1, "CalendarEvent1.ics");
+ CDSAddEntryResult addEvent2Result = getEventsListTest.AddEvent(1, "CalendarEvent2.ics");
+ CDSAddEntryResult addEvent3Result = getEventsListTest.AddEvent(1, "CalendarEvent3.ics");
- CDSEntryList entryList = GetEventsListTest.GetEventList(1);
+ CDSEntryList entryList = getEventsListTest.GetEventList(1);
EXPECT_EQ(1, entryList.entryList.at(0));
EXPECT_EQ(2, entryList.entryList.at(1));
// Setup the second account.
- addEvent1Result = GetEventsListTest.AddEvent(2, "CalendarEvent1.ics");
- addEvent2Result = GetEventsListTest.AddEvent(2, "CalendarEvent2.ics");
- addEvent3Result = GetEventsListTest.AddEvent(2, "CalendarEvent3.ics");
+ addEvent1Result = getEventsListTest.AddEvent(2, "CalendarEvent1.ics");
+ addEvent2Result = getEventsListTest.AddEvent(2, "CalendarEvent2.ics");
+ addEvent3Result = getEventsListTest.AddEvent(2, "CalendarEvent3.ics");
- entryList = GetEventsListTest.GetEventList(2);
+ entryList = getEventsListTest.GetEventList(2);
EXPECT_EQ(4, entryList.entryList.at(0));
EXPECT_EQ(5, entryList.entryList.at(1));
// Setup the third account.
- addEvent1Result = GetEventsListTest.AddEvent(3, "CalendarEvent1.ics");
- addEvent2Result = GetEventsListTest.AddEvent(3, "CalendarEvent2.ics");
- addEvent3Result = GetEventsListTest.AddEvent(3, "CalendarEvent3.ics");
+ addEvent1Result = getEventsListTest.AddEvent(3, "CalendarEvent1.ics");
+ addEvent2Result = getEventsListTest.AddEvent(3, "CalendarEvent2.ics");
+ addEvent3Result = getEventsListTest.AddEvent(3, "CalendarEvent3.ics");
- entryList = GetEventsListTest.GetEventList(3);
+ entryList = getEventsListTest.GetEventList(3);
EXPECT_EQ(7, entryList.entryList.at(0));
EXPECT_EQ(8, entryList.entryList.at(1));
TEST(CalendarDataStorage, Get_List_Of_Calendars_For_One_Account){
- CalendarDataStorage GetEventsListTest;
+ CalendarDataStorage getEventsListTest;
- GetEventsListTest.AddAccount("Test Account 1", 1);
+ getEventsListTest.AddAccount("Test Account 1", 1);
// Setup the first account.
- 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");
+ 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.
- CDSCalendarList calendarList = GetEventsListTest.GetCalendarList(1);
+ CDSCalendarList calendarList = getEventsListTest.GetCalendarList(1);
EXPECT_EQ(1, calendarList.calendarList.at(0));
EXPECT_EQ(2, calendarList.calendarList.at(1));
TEST(CalendarDataStorage, Get_List_Of_Calendars_For_Two_Accounts){
- CalendarDataStorage GetEventsListTest;
+ CalendarDataStorage getEventsListTest;
- GetEventsListTest.AddAccount("Test Account 1", 1);
- GetEventsListTest.AddAccount("Test Account 2", 2);
+ getEventsListTest.AddAccount("Test Account 1", 1);
+ getEventsListTest.AddAccount("Test Account 2", 2);
// Setup the first account.
- 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");
+ 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.
- CDSCalendarList calendarList = GetEventsListTest.GetCalendarList(1);
+ CDSCalendarList calendarList = getEventsListTest.GetCalendarList(1);
EXPECT_EQ(1, calendarList.calendarList.at(0));
EXPECT_EQ(2, calendarList.calendarList.at(1));
// Setup the second account.
- 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");
+ 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);
+ calendarList = getEventsListTest.GetCalendarList(2);
EXPECT_EQ(4, calendarList.calendarList.at(0));
EXPECT_EQ(5, calendarList.calendarList.at(1));
TEST(CalendarDataStorage, Get_List_Of_Calendars_For_Three_Accounts){
- CalendarDataStorage GetEventsListTest;
+ CalendarDataStorage getEventsListTest;
- GetEventsListTest.AddAccount("Test Account 1", 1);
- GetEventsListTest.AddAccount("Test Account 2", 2);
- GetEventsListTest.AddAccount("Test Account 3", 3);
+ getEventsListTest.AddAccount("Test Account 1", 1);
+ getEventsListTest.AddAccount("Test Account 2", 2);
+ getEventsListTest.AddAccount("Test Account 3", 3);
// Setup the first account.
- 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");
+ 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.
- CDSCalendarList calendarList = GetEventsListTest.GetCalendarList(1);
+ CDSCalendarList calendarList = getEventsListTest.GetCalendarList(1);
EXPECT_EQ(1, calendarList.calendarList.at(0));
EXPECT_EQ(2, calendarList.calendarList.at(1));
// Setup the second account.
- 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");
+ 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);
+ calendarList = getEventsListTest.GetCalendarList(2);
EXPECT_EQ(4, calendarList.calendarList.at(0));
EXPECT_EQ(5, calendarList.calendarList.at(1));
// Setup the third account.
- 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");
+ 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);
+ calendarList = getEventsListTest.GetCalendarList(3);
EXPECT_EQ(7, calendarList.calendarList.at(0));
EXPECT_EQ(8, calendarList.calendarList.at(1));
TEST(CalendarDataStorage, Add_One_Checksum){
- CalendarDataStorage ChecksumTest;
+ CalendarDataStorage checksumTest;
- EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("firstChecksum", "checksumYay"));
+ EXPECT_EQ(CDSCHECKSUM_OK, checksumTest.AddChecksum("firstChecksum", "checksumYay"));
// Get the checksum.
- //EXPECT_EQ("checksumYay", ChecksumTest.GetChecksum("firstChecksum"));
+ //EXPECT_EQ("checksumYay", checksumTest.GetChecksum("firstChecksum"));
}
TEST(CalendarDataStorage, Add_Two_Checksus){
- CalendarDataStorage ChecksumTest;
+ CalendarDataStorage checksumTest;
- EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("firstChecksum", "checksumYay"));
- EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("secondChecksum", "checksumTwo"));
+ EXPECT_EQ(CDSCHECKSUM_OK, checksumTest.AddChecksum("firstChecksum", "checksumYay"));
+ EXPECT_EQ(CDSCHECKSUM_OK, checksumTest.AddChecksum("secondChecksum", "checksumTwo"));
}
TEST(CalendarDataStorage, Add_Three_Checksus){
- CalendarDataStorage ChecksumTest;
+ 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"));
+ 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;
+ CalendarDataStorage checksumTest;
- EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("firstChecksum", "checksumYay"));
+ EXPECT_EQ(CDSCHECKSUM_OK, checksumTest.AddChecksum("firstChecksum", "checksumYay"));
// Get the checksum.
- CDSGetChecksumResult getChecksumResult = ChecksumTest.GetChecksum("firstChecksum");
+ 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;
+ CalendarDataStorage checksumTest;
- EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("firstChecksum", "checksumYay"));
- EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("secondChecksum", "checksumTwo"));
+ EXPECT_EQ(CDSCHECKSUM_OK, checksumTest.AddChecksum("firstChecksum", "checksumYay"));
+ EXPECT_EQ(CDSCHECKSUM_OK, checksumTest.AddChecksum("secondChecksum", "checksumTwo"));
// Get the checksums.
- CDSGetChecksumResult getChecksumResult = ChecksumTest.GetChecksum("firstChecksum");
+ CDSGetChecksumResult getChecksumResult = checksumTest.GetChecksum("firstChecksum");
EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult);
EXPECT_EQ("checksumYay", getChecksumResult.checksumValue);
- getChecksumResult = ChecksumTest.GetChecksum("secondChecksum");
+ 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;
+ 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"));
+ 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");
+ CDSGetChecksumResult getChecksumResult = checksumTest.GetChecksum("firstChecksum");
EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult);
EXPECT_EQ("checksumYay", getChecksumResult.checksumValue);
- getChecksumResult = ChecksumTest.GetChecksum("secondChecksum");
+ getChecksumResult = checksumTest.GetChecksum("secondChecksum");
EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult);
EXPECT_EQ("checksumTwo", getChecksumResult.checksumValue);
- getChecksumResult = ChecksumTest.GetChecksum("thirdChecksum");
+ 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;
+ CalendarDataStorage checksumTest;
- EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("firstChecksum", "checksumYay"));
+ EXPECT_EQ(CDSCHECKSUM_OK, checksumTest.AddChecksum("firstChecksum", "checksumYay"));
// Get the checksum.
- CDSGetChecksumResult getChecksumResult = ChecksumTest.GetChecksum("firstChecksum");
+ 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"));
+ EXPECT_EQ(CDSCHECKSUM_OK, checksumTest.UpdateChecksum("firstChecksum", "updatedChecksum1"));
// Get the checksum again.
- getChecksumResult = ChecksumTest.GetChecksum("firstChecksum");
+ 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;
+ CalendarDataStorage checksumTest;
- EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("firstChecksum", "checksumYay"));
- EXPECT_EQ(CDSCHECKSUM_OK, ChecksumTest.AddChecksum("secondChecksum", "checksumTwo"));
+ EXPECT_EQ(CDSCHECKSUM_OK, checksumTest.AddChecksum("firstChecksum", "checksumYay"));
+ EXPECT_EQ(CDSCHECKSUM_OK, checksumTest.AddChecksum("secondChecksum", "checksumTwo"));
// Get the checksum.
- CDSGetChecksumResult getChecksumResult = ChecksumTest.GetChecksum("firstChecksum");
+ CDSGetChecksumResult getChecksumResult = checksumTest.GetChecksum("firstChecksum");
EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult);
EXPECT_EQ("checksumYay", getChecksumResult.checksumValue);
- getChecksumResult = ChecksumTest.GetChecksum("secondChecksum");
+ 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"));
+ EXPECT_EQ(CDSCHECKSUM_OK, checksumTest.UpdateChecksum("firstChecksum", "updatedChecksum1"));
+ EXPECT_EQ(CDSCHECKSUM_OK, checksumTest.UpdateChecksum("secondChecksum", "updatedChecksum2"));
// Get the checksum again.
- getChecksumResult = ChecksumTest.GetChecksum("firstChecksum");
+ getChecksumResult = checksumTest.GetChecksum("firstChecksum");
EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult);
EXPECT_EQ("updatedChecksum1", getChecksumResult.checksumValue);
- getChecksumResult = ChecksumTest.GetChecksum("secondChecksum");
+ 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;
+ 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"));
+ 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");
+ CDSGetChecksumResult getChecksumResult = checksumTest.GetChecksum("firstChecksum");
EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult);
EXPECT_EQ("checksumYay", getChecksumResult.checksumValue);
- getChecksumResult = ChecksumTest.GetChecksum("secondChecksum");
+ getChecksumResult = checksumTest.GetChecksum("secondChecksum");
EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult);
EXPECT_EQ("checksumTwo", getChecksumResult.checksumValue);
- getChecksumResult = ChecksumTest.GetChecksum("thirdChecksum");
+ 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"));
+ 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");
+ getChecksumResult = checksumTest.GetChecksum("firstChecksum");
EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult);
EXPECT_EQ("updatedChecksum1", getChecksumResult.checksumValue);
- getChecksumResult = ChecksumTest.GetChecksum("secondChecksum");
+ getChecksumResult = checksumTest.GetChecksum("secondChecksum");
EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult);
EXPECT_EQ("updatedChecksum2", getChecksumResult.checksumValue);
- getChecksumResult = ChecksumTest.GetChecksum("thirdChecksum");
+ getChecksumResult = checksumTest.GetChecksum("thirdChecksum");
EXPECT_EQ(CDSCHECKSUM_OK, getChecksumResult.getChecksumResult);
EXPECT_EQ("updatedChecksum3", getChecksumResult.checksumValue);
// Setup the objects to be used for processing.
- vector<string> TextPropertiesExample1;
- vector<string> TextValueExample1;
- multimap<string, string> TextExample1TestResult;
+ vector<string> textPropertiesExample1;
+ vector<string> textValueExample1;
+ multimap<string, string> textExample1TestResult;
- TextPropertiesExample1.push_back("ATTENDEE");
- TextValueExample1.push_back("Example Attendee 1");
+ textPropertiesExample1.push_back("ATTENDEE");
+ textValueExample1.push_back("Example Attendee 1");
- TextPropertiesExample1.push_back("ATTENDEE");
- TextValueExample1.push_back("Example Attendee 2");
+ textPropertiesExample1.push_back("ATTENDEE");
+ textValueExample1.push_back("Example Attendee 2");
- TextPropertiesExample1.push_back("ATTENDEE");
- TextValueExample1.push_back("Example Attendee 3");
+ textPropertiesExample1.push_back("ATTENDEE");
+ textValueExample1.push_back("Example Attendee 3");
- TextPropertiesExample1.push_back("CATEGORIES");
- TextValueExample1.push_back("CATEGORY 1");
+ textPropertiesExample1.push_back("CATEGORIES");
+ textValueExample1.push_back("CATEGORY 1");
- TextPropertiesExample1.push_back("CATEGORIES");
- TextValueExample1.push_back("CATEGORY 2");
+ textPropertiesExample1.push_back("CATEGORIES");
+ textValueExample1.push_back("CATEGORY 2");
- TextPropertiesExample1.push_back("CATEGORIES");
- TextValueExample1.push_back("CATEGORY 3");
+ textPropertiesExample1.push_back("CATEGORIES");
+ textValueExample1.push_back("CATEGORY 3");
- TextPropertiesExample1.push_back("COMMENT");
- TextValueExample1.push_back("This is the first comment.");
+ textPropertiesExample1.push_back("COMMENT");
+ textValueExample1.push_back("This is the first comment.");
- TextPropertiesExample1.push_back("COMMENT");
- TextValueExample1.push_back("This is the second comment.");
+ textPropertiesExample1.push_back("COMMENT");
+ textValueExample1.push_back("This is the second comment.");
- TextPropertiesExample1.push_back("COMMENT");
- TextValueExample1.push_back("This is the third comment.");
+ textPropertiesExample1.push_back("COMMENT");
+ textValueExample1.push_back("This is the third comment.");
- TextPropertiesExample1.push_back("CONTACT;TEST=VALUE");
- TextValueExample1.push_back("First Contact");
+ textPropertiesExample1.push_back("CONTACT;TEST=VALUE");
+ textValueExample1.push_back("First Contact");
- TextPropertiesExample1.push_back("CONTACT;LAZY=NOPE");
- TextValueExample1.push_back("Second Contact");
+ textPropertiesExample1.push_back("CONTACT;LAZY=NOPE");
+ textValueExample1.push_back("Second Contact");
- TextPropertiesExample1.push_back("CONTACT;SETUP=NO");
- TextValueExample1.push_back("Third Contact");
+ textPropertiesExample1.push_back("CONTACT;SETUP=NO");
+ textValueExample1.push_back("Third Contact");
- TextPropertiesExample1.push_back("RESOURCES;ROOM=YES");
- TextValueExample1.push_back("First Resource Widget");
+ textPropertiesExample1.push_back("RESOURCES;ROOM=YES");
+ textValueExample1.push_back("First Resource Widget");
- TextPropertiesExample1.push_back("RESOURCES;ROOM=NO");
- TextValueExample1.push_back("Second Resource Widget");
+ textPropertiesExample1.push_back("RESOURCES;ROOM=NO");
+ textValueExample1.push_back("Second Resource Widget");
- TextPropertiesExample1.push_back("RESOURCES;ROOM=UNKNOWN");
- TextValueExample1.push_back("Third Resource Widget");
+ textPropertiesExample1.push_back("RESOURCES;ROOM=UNKNOWN");
+ textValueExample1.push_back("Third Resource Widget");
- TextPropertiesExample1.push_back("RELATED;RELATION=NO");
- TextValueExample1.push_back("First Relation");
+ textPropertiesExample1.push_back("RELATED;RELATION=NO");
+ textValueExample1.push_back("First Relation");
- TextPropertiesExample1.push_back("RELATED;RELATION=YES");
- TextValueExample1.push_back("Second Relation");
+ textPropertiesExample1.push_back("RELATED;RELATION=YES");
+ textValueExample1.push_back("Second Relation");
- TextPropertiesExample1.push_back("RELATED;RELATION=MAYBE");
- TextValueExample1.push_back("Third Relation");
+ textPropertiesExample1.push_back("RELATED;RELATION=MAYBE");
+ textValueExample1.push_back("Third Relation");
// Examples 1 & 2: ATTENDEE
- TextExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 1"));
- TextExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 2"));
- TextExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 3"));
+ textExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 1"));
+ textExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 2"));
+ textExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 3"));
- ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "ATTENDEE"));
+ ASSERT_EQ(textExample1TestResult, ProcessTextVectors(&textPropertiesExample1, &textValueExample1, true, "ATTENDEE"));
- TextExample1TestResult.clear();
- TextExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 1"));
+ textExample1TestResult.clear();
+ textExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 1"));
- ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "ATTENDEE"));
+ ASSERT_EQ(textExample1TestResult, ProcessTextVectors(&textPropertiesExample1, &textValueExample1, false, "ATTENDEE"));
// Examples 3 & 4: CATEGORIES
- TextExample1TestResult.clear();
- TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 1"));
- TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 2"));
- TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 3"));
+ textExample1TestResult.clear();
+ textExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 1"));
+ textExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 2"));
+ textExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 3"));
- ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "CATEGORIES"));
+ ASSERT_EQ(textExample1TestResult, ProcessTextVectors(&textPropertiesExample1, &textValueExample1, true, "CATEGORIES"));
- TextExample1TestResult.clear();
- TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 1"));
+ textExample1TestResult.clear();
+ textExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 1"));
// Examples 5 & 6: COMMENT
- ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "CATEGORIES"));
+ ASSERT_EQ(textExample1TestResult, ProcessTextVectors(&textPropertiesExample1, &textValueExample1, false, "CATEGORIES"));
- TextExample1TestResult.clear();
- TextExample1TestResult.insert(make_pair("COMMENT", "This is the first comment."));
- TextExample1TestResult.insert(make_pair("COMMENT", "This is the second comment."));
- TextExample1TestResult.insert(make_pair("COMMENT", "This is the third comment."));
+ textExample1TestResult.clear();
+ textExample1TestResult.insert(make_pair("COMMENT", "This is the first comment."));
+ textExample1TestResult.insert(make_pair("COMMENT", "This is the second comment."));
+ textExample1TestResult.insert(make_pair("COMMENT", "This is the third comment."));
- ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "COMMENT"));
+ ASSERT_EQ(textExample1TestResult, ProcessTextVectors(&textPropertiesExample1, &textValueExample1, true, "COMMENT"));
- TextExample1TestResult.clear();
- TextExample1TestResult.insert(make_pair("COMMENT", "This is the first comment."));
+ textExample1TestResult.clear();
+ textExample1TestResult.insert(make_pair("COMMENT", "This is the first comment."));
// Examples 7 & 8: CONTACT;(properties)
- ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "COMMENT"));
+ ASSERT_EQ(textExample1TestResult, ProcessTextVectors(&textPropertiesExample1, &textValueExample1, false, "COMMENT"));
- TextExample1TestResult.clear();
- TextExample1TestResult.insert(make_pair("CONTACT;TEST=VALUE", "First Contact"));
- TextExample1TestResult.insert(make_pair("CONTACT;LAZY=NOPE", "Second Contact"));
- TextExample1TestResult.insert(make_pair("CONTACT;SETUP=NO", "Third Contact"));
+ textExample1TestResult.clear();
+ textExample1TestResult.insert(make_pair("CONTACT;TEST=VALUE", "First Contact"));
+ textExample1TestResult.insert(make_pair("CONTACT;LAZY=NOPE", "Second Contact"));
+ textExample1TestResult.insert(make_pair("CONTACT;SETUP=NO", "Third Contact"));
- ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "CONTACT"));
+ ASSERT_EQ(textExample1TestResult, ProcessTextVectors(&textPropertiesExample1, &textValueExample1, true, "CONTACT"));
- TextExample1TestResult.clear();
- TextExample1TestResult.insert(make_pair("CONTACT;TEST=VALUE", "First Contact"));
+ textExample1TestResult.clear();
+ textExample1TestResult.insert(make_pair("CONTACT;TEST=VALUE", "First Contact"));
// Examples 9 & 10: RESOURCES;(properties)
- ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "CONTACT"));
+ ASSERT_EQ(textExample1TestResult, ProcessTextVectors(&textPropertiesExample1, &textValueExample1, false, "CONTACT"));
- TextExample1TestResult.clear();
- TextExample1TestResult.insert(make_pair("RESOURCES;ROOM=YES", "First Resource Widget"));
- TextExample1TestResult.insert(make_pair("RESOURCES;ROOM=NO", "Second Resource Widget"));
- TextExample1TestResult.insert(make_pair("RESOURCES;ROOM=UNKNOWN", "Third Resource Widget"));
+ textExample1TestResult.clear();
+ textExample1TestResult.insert(make_pair("RESOURCES;ROOM=YES", "First Resource Widget"));
+ textExample1TestResult.insert(make_pair("RESOURCES;ROOM=NO", "Second Resource Widget"));
+ textExample1TestResult.insert(make_pair("RESOURCES;ROOM=UNKNOWN", "Third Resource Widget"));
- ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "RESOURCES"));
+ ASSERT_EQ(textExample1TestResult, ProcessTextVectors(&textPropertiesExample1, &textValueExample1, true, "RESOURCES"));
- TextExample1TestResult.clear();
- TextExample1TestResult.insert(make_pair("RESOURCES;ROOM=YES", "First Resource Widget"));
+ textExample1TestResult.clear();
+ textExample1TestResult.insert(make_pair("RESOURCES;ROOM=YES", "First Resource Widget"));
- ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "RESOURCES"));
+ ASSERT_EQ(textExample1TestResult, ProcessTextVectors(&textPropertiesExample1, &textValueExample1, false, "RESOURCES"));
// Examples 11 & 12: RELATED;(properties)
- TextExample1TestResult.clear();
- TextExample1TestResult.insert(make_pair("RELATED;RELATION=NO", "First Relation"));
- TextExample1TestResult.insert(make_pair("RELATED;RELATION=YES", "Second Relation"));
- TextExample1TestResult.insert(make_pair("RELATED;RELATION=MAYBE", "Third Relation"));
+ textExample1TestResult.clear();
+ textExample1TestResult.insert(make_pair("RELATED;RELATION=NO", "First Relation"));
+ textExample1TestResult.insert(make_pair("RELATED;RELATION=YES", "Second Relation"));
+ textExample1TestResult.insert(make_pair("RELATED;RELATION=MAYBE", "Third Relation"));
- ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "RELATED"));
+ ASSERT_EQ(textExample1TestResult, ProcessTextVectors(&textPropertiesExample1, &textValueExample1, true, "RELATED"));
- TextExample1TestResult.clear();
- TextExample1TestResult.insert(make_pair("RELATED;RELATION=NO", "First Relation"));
+ textExample1TestResult.clear();
+ textExample1TestResult.insert(make_pair("RELATED;RELATION=NO", "First Relation"));
- ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "RELATED"));
+ ASSERT_EQ(textExample1TestResult, ProcessTextVectors(&textPropertiesExample1, &textValueExample1, false, "RELATED"));
}
TEST(CommonFunctions, SplitValuesTests){
- map<string, string> TextExample1TestResult;
+ map<string, string> textExample1TestResult;
- TextExample1TestResult.insert(make_pair("RELATION", "NO"));
- TextExample1TestResult.insert(make_pair("TEST", "YES"));
- TextExample1TestResult.insert(make_pair("DATA", "SOMEDATA"));
+ textExample1TestResult.insert(make_pair("RELATION", "NO"));
+ textExample1TestResult.insert(make_pair("TEST", "YES"));
+ textExample1TestResult.insert(make_pair("DATA", "SOMEDATA"));
- ASSERT_EQ(TextExample1TestResult, SplitValues("TEST;RELATION=NO;TEST=YES;DATA=SOMEDATA"));
+ ASSERT_EQ(textExample1TestResult, SplitValues("TEST;RELATION=NO;TEST=YES;DATA=SOMEDATA"));
}
TEST(CommonFunctions, SplitNameValueTests){
- PropertyNameValue NameValueResult;
+ PropertyNameValue nameValueResult;
- NameValueResult = SplitNameValue("TEST=OK");
+ nameValueResult = SplitNameValue("TEST=OK");
- string PropertyName = NameValueResult.Name;
- string PropertyValue = NameValueResult.Value;
+ string PropertyName = nameValueResult.name;
+ string PropertyValue = nameValueResult.value;
- ASSERT_EQ(PropertyName, "TEST");
- ASSERT_EQ(PropertyValue, "OK");
+ ASSERT_EQ(propertyName, "TEST");
+ ASSERT_EQ(propertyValue, "OK");
}
TEST(CommonFunctions, HexToInt){
- string Value1 = "10"; // 16
- string Value2 = "50"; // 80
- string Value3 = "4F"; // 79
- string Value4 = "FF"; // 255
- string Value5 = "FFF"; // 4095
- string Value6 = "FFFF"; // 65535
- string Value7 = "75AB"; // 30123
- string Value8 = "2AC"; // 684
- string Value9 = "!"; // Fail
- string Value10 = "4BZ"; // Fail
- string Value11 = "Z?!$"; // Fail
+ string value1 = "10"; // 16
+ string value2 = "50"; // 80
+ string value3 = "4F"; // 79
+ string value4 = "FF"; // 255
+ string value5 = "FFF"; // 4095
+ string value6 = "FFFF"; // 65535
+ string value7 = "75AB"; // 30123
+ string value8 = "2AC"; // 684
+ string value9 = "!"; // Fail
+ string value10 = "4BZ"; // Fail
+ string value11 = "Z?!$"; // Fail
- int OutputValue = 0;
- bool Result = false;
+ int outputValue = 0;
+ bool result = false;
- Result = HexToInt(&Value1, &OutputValue);
+ result = HexToInt(&value1, &outputValue);
- ASSERT_EQ(Result, true);
- ASSERT_EQ(OutputValue, 16);
+ ASSERT_EQ(result, true);
+ ASSERT_EQ(outputValue, 16);
- Result = HexToInt(&Value2, &OutputValue);
- ASSERT_EQ(Result, true);
- ASSERT_EQ(OutputValue, 80);
+ result = HexToInt(&value2, &outputValue);
+ ASSERT_EQ(result, true);
+ ASSERT_EQ(outputValue, 80);
- Result = HexToInt(&Value3, &OutputValue);
- ASSERT_EQ(Result, true);
- ASSERT_EQ(OutputValue, 79);
+ result = HexToInt(&value3, &outputValue);
+ ASSERT_EQ(result, true);
+ ASSERT_EQ(outputValue, 79);
- Result = HexToInt(&Value4, &OutputValue);
- ASSERT_EQ(Result, true);
- ASSERT_EQ(OutputValue, 255);
+ result = HexToInt(&value4, &outputValue);
+ ASSERT_EQ(result, true);
+ ASSERT_EQ(outputValue, 255);
- Result = HexToInt(&Value5, &OutputValue);
- ASSERT_EQ(Result, true);
- ASSERT_EQ(OutputValue, 4095);
+ result = HexToInt(&value5, &outputValue);
+ ASSERT_EQ(result, true);
+ ASSERT_EQ(outputValue, 4095);
- Result = HexToInt(&Value6, &OutputValue);
- ASSERT_EQ(Result, true);
- ASSERT_EQ(OutputValue, 65535);
+ result = HexToInt(&value6, &outputValue);
+ ASSERT_EQ(result, true);
+ ASSERT_EQ(outputValue, 65535);
- Result = HexToInt(&Value7, &OutputValue);
- ASSERT_EQ(Result, true);
- ASSERT_EQ(OutputValue, 30123);
+ result = HexToInt(&value7, &outputValue);
+ ASSERT_EQ(result, true);
+ ASSERT_EQ(outputValue, 30123);
- Result = HexToInt(&Value8, &OutputValue);
- ASSERT_EQ(Result, true);
- ASSERT_EQ(OutputValue, 684);
+ result = HexToInt(&value8, &outputValue);
+ ASSERT_EQ(result, true);
+ ASSERT_EQ(outputValue, 684);
- Result = HexToInt(&Value9, &OutputValue);
- ASSERT_EQ(Result, false);
+ result = HexToInt(&value9, &outputValue);
+ ASSERT_EQ(result, false);
- Result = HexToInt(&Value10, &OutputValue);
- ASSERT_EQ(Result, false);
+ result = HexToInt(&value10, &outputValue);
+ ASSERT_EQ(result, false);
- Result = HexToInt(&Value11, &OutputValue);
- ASSERT_EQ(Result, false);
+ result = HexToInt(&value11, &outputValue);
+ ASSERT_EQ(result, false);
}
// Setup the file split.
- string PathFilenameOriginal = "/example/file/yay.txt";
- string Path = "";
- string File = "";
+ string pathFilenameOriginal = "/example/file/yay.txt";
+ string path = "";
+ string file = "";
- SplitPathFilename(&PathFilenameOriginal, &Path, &File);
+ SplitPathFilename(&pathFilenameOriginal, &path, &file);
- ASSERT_EQ("/example/file/", Path);
- ASSERT_EQ("yay.txt", File);
+ ASSERT_EQ("/example/file/", path);
+ ASSERT_EQ("yay.txt", file);
- PathFilenameOriginal = "/a/path/with/lots/of/bits/in/andthenthis.html";
- Path.clear();
- File.clear();
+ pathFilenameOriginal = "/a/path/with/lots/of/bits/in/andthenthis.html";
+ path.clear();
+ file.clear();
- SplitPathFilename(&PathFilenameOriginal, &Path, &File);
+ SplitPathFilename(&pathFilenameOriginal, &path, &file);
- ASSERT_EQ("/a/path/with/lots/of/bits/in/", Path);
- ASSERT_EQ("andthenthis.html", File);
+ ASSERT_EQ("/a/path/with/lots/of/bits/in/", path);
+ ASSERT_EQ("andthenthis.html", file);
- PathFilenameOriginal = "/one/more/for/a/laugh/hahaha.zip";
- Path.clear();
- File.clear();
+ pathFilenameOriginal = "/one/more/for/a/laugh/hahaha.zip";
+ path.clear();
+ file.clear();
- SplitPathFilename(&PathFilenameOriginal, &Path, &File);
+ SplitPathFilename(&pathFilenameOriginal, &path, &file);
- ASSERT_EQ("/one/more/for/a/laugh/", Path);
- ASSERT_EQ("hahaha.zip", File);
+ ASSERT_EQ("/one/more/for/a/laugh/", path);
+ ASSERT_EQ("hahaha.zip", file);
}
TEST(CommonFunctions, ColourStruct){
- Colour Colour1;
- Colour Colour2;
- Colour Colour3;
- Colour Colour4;
-
- Colour1.red = 0;
- Colour1.green = 0;
- Colour1.blue = 0;
- Colour1.alpha = 0;
-
- Colour2.red = 512;
- Colour2.green = 512;
- Colour2.blue = 512;
- Colour2.alpha = 512;
-
- Colour3.red = 16;
- Colour3.green = 16;
- Colour3.blue = 16;
- Colour3.alpha = 16;
-
- Colour4.red = 80;
- Colour4.green = 80;
- Colour4.blue = 80;
- Colour4.alpha = 80;
-
- ASSERT_EQ("#00000000", (string)Colour1);
- ASSERT_EQ("#FFFFFFFF", (string)Colour2);
- ASSERT_EQ("#10101010", (string)Colour3);
- ASSERT_EQ("#50505050", (string)Colour4);
-
- string ColourInput1 = "#204040FF";
- string ColourInput2 = "#408080FF";
- string ColourInput3 = "#A0A0A000";
- string ColourInput4 = "#FFFFFF20";
-
- Colour Colour5;
- Colour Colour6;
- Colour Colour7;
- Colour Colour8;
-
- Colour5 = ColourInput1;
- Colour6 = ColourInput2;
- Colour7 = ColourInput3;
- Colour8 = ColourInput4;
-
- ASSERT_EQ(32, Colour5.red);
- ASSERT_EQ(64, Colour5.green);
- ASSERT_EQ(64, Colour5.blue);
- ASSERT_EQ(255, Colour5.alpha);
-
- ASSERT_EQ(64, Colour6.red);
- ASSERT_EQ(128, Colour6.green);
- ASSERT_EQ(128, Colour6.blue);
- ASSERT_EQ(255, Colour6.alpha);
-
- ASSERT_EQ(160, Colour7.red);
- ASSERT_EQ(160, Colour7.green);
- ASSERT_EQ(160, Colour7.blue);
- ASSERT_EQ(0, Colour7.alpha);
-
- ASSERT_EQ(255, Colour8.red);
- ASSERT_EQ(255, Colour8.green);
- ASSERT_EQ(255, Colour8.blue);
- ASSERT_EQ(32, Colour8.alpha);
+ Colour colour1;
+ Colour colour2;
+ Colour colour3;
+ Colour colour4;
+
+ colour1.red = 0;
+ colour1.green = 0;
+ colour1.blue = 0;
+ colour1.alpha = 0;
+
+ colour2.red = 512;
+ colour2.green = 512;
+ colour2.blue = 512;
+ colour2.alpha = 512;
+
+ colour3.red = 16;
+ colour3.green = 16;
+ colour3.blue = 16;
+ colour3.alpha = 16;
+
+ colour4.red = 80;
+ colour4.green = 80;
+ colour4.blue = 80;
+ colour4.alpha = 80;
+
+ ASSERT_EQ("#00000000", (string)colour1);
+ ASSERT_EQ("#FFFFFFFF", (string)colour2);
+ ASSERT_EQ("#10101010", (string)colour3);
+ ASSERT_EQ("#50505050", (string)colour4);
+
+ string colourInput1 = "#204040FF";
+ string colourInput2 = "#408080FF";
+ string colourInput3 = "#A0A0A000";
+ string colourInput4 = "#FFFFFF20";
+
+ Colour colour5;
+ Colour colour6;
+ Colour colour7;
+ Colour colour8;
+
+ colour5 = colourInput1;
+ colour6 = colourInput2;
+ colour7 = colourInput3;
+ colour8 = colourInput4;
+
+ ASSERT_EQ(32, colour5.red);
+ ASSERT_EQ(64, colour5.green);
+ ASSERT_EQ(64, colour5.blue);
+ ASSERT_EQ(255, colour5.alpha);
+
+ ASSERT_EQ(64, colour6.red);
+ ASSERT_EQ(128, colour6.green);
+ ASSERT_EQ(128, colour6.blue);
+ ASSERT_EQ(255, colour6.alpha);
+
+ ASSERT_EQ(160, colour7.red);
+ ASSERT_EQ(160, colour7.green);
+ ASSERT_EQ(160, colour7.blue);
+ ASSERT_EQ(0, colour7.alpha);
+
+ ASSERT_EQ(255, colour8.red);
+ ASSERT_EQ(255, colour8.green);
+ ASSERT_EQ(255, colour8.blue);
+ ASSERT_EQ(32, colour8.alpha);
}
TEST(CommonFunctions, OutputText){
- string InputText1 = "This is an example text.";
- string OutputText1 = "This is an example text.";
- string ResultText1 = "";
+ string inputText1 = "This is an example text.";
+ string outputText1 = "This is an example text.";
+ string resultText1 = "";
- string InputText2 = "This is the first sentence. This is the second sentence"
+ string inputText2 = "This is the first sentence. This is the second sentence"
". This is the third sentence. This is the fourth sentence. This "
"is the fifth sentence.";
- string OutputText2 = "This is the first sentence. This is the second sentence"
+ string outputText2 = "This is the first sentence. This is the second sentence"
". This is the third se\n ntence. This is the fourth sentence. This "
"is the fifth sentence.";
- string ResultText2 = "";
+ string resultText2 = "";
- string InputText3 = "This is the first sentence. This is the second sentence"
+ string inputText3 = "This is the first sentence. This is the second sentence"
". This is the third sentence. This is the fourth sentence. This "
"is the fifth sentence. This is the sixth sentence. This is the s"
"eventh sentence. This is the eighth sentence. This is the ninth "
"sentence. This is the tenth sentence.";
- string OutputText3 = "This is the first sentence. This is the second sentence. This is the third se\n"
+ string outputText3 = "This is the first sentence. This is the second sentence. This is the third se\n"
" ntence. This is the fourth sentence. This is the fifth sentence. This is the\n"
" sixth sentence. This is the seventh sentence. This is the eighth sentence. \n"
" This is the ninth sentence. This is the tenth sentence.";
- string ResultText3 = "";
+ string resultText3 = "";
- string InputText4 = "This is the first sentence. This is the second sentence"
+ string inputText4 = "This is the first sentence. This is the second sentence"
". This is the third sentence. This is the fourth sentence. This "
"is the fifth sentence. This is the sixth sentence. This is the s"
"eventh sentence. This is the eighth sentence. This is the ninth "
"nce. This is the twelfth sentence. This is the thirteenth senten"
"ce. This is the fourteenth sentence. This is the fifteenth sente"
"nce.";
- string OutputText4 = "This is the first sentence. This is the second sentence. This is the third se\n"
+ string outputText4 = "This is the first sentence. This is the second sentence. This is the third se\n"
" ntence. This is the fourth sentence. This is the fifth sentence. This is the\n"
" sixth sentence. This is the seventh sentence. This is the eighth sentence. \n"
" This is the ninth sentence. This is the tenth sentence. This is the eleventh\n"
" sentence. This is the twelfth sentence. This is the thirteenth sentence. Th\n"
" is is the fourteenth sentence. This is the fifteenth sentence.";
- string ResultText4 = "";
+ string resultText4 = "";
- string InputText5 = "This is the first sentence. This is the second sentence"
+ string inputText5 = "This is the first sentence. This is the second sentence"
". This is the third sentence. This is the fourth sentence. This "
"is the fifth sentence. This is the sixth sentence. This is the s"
"eventh sentence. This is the eighth sentence. This is the ninth "
"nce. This is the sixteenth sentence. This is the seventeenth sen"
"tence. This is the eighteenth sentence. This is the ninteenth se"
"ntence. This is the twentieth sentence.";
- string OutputText5 = "This is the first sentence. This is the second sentence. This is the third se\n"
+ string outputText5 = "This is the first sentence. This is the second sentence. This is the third se\n"
" ntence. This is the fourth sentence. This is the fifth sentence. This is the\n"
" sixth sentence. This is the seventh sentence. This is the eighth sentence. \n"
" This is the ninth sentence. This is the tenth sentence. This is the eleventh\n"
" is is the fourteenth sentence. This is the fifteenth sentence. This is the s\n"
" ixteenth sentence. This is the seventeenth sentence. This is the eighteenth \n"
" sentence. This is the ninteenth sentence. This is the twentieth sentence.";
- string ResultText5;
+ string resultText5;
- ResultText1 = OutputText(&InputText1);
- ResultText2 = OutputText(&InputText2);
- ResultText3 = OutputText(&InputText3);
- ResultText4 = OutputText(&InputText4);
- ResultText5 = OutputText(&InputText5);
+ resultText1 = OutputText(&inputText1);
+ resultText2 = OutputText(&inputText2);
+ resultText3 = OutputText(&inputText3);
+ resultText4 = OutputText(&inputText4);
+ resultText5 = OutputText(&inputText5);
- ASSERT_EQ(ResultText1, OutputText1);
- ASSERT_EQ(ResultText2, OutputText2);
- ASSERT_EQ(ResultText3, OutputText3);
- ASSERT_EQ(ResultText4, OutputText4);
- ASSERT_EQ(ResultText5, OutputText5);
+ ASSERT_EQ(resultText1, outputText1);
+ ASSERT_EQ(resultText2, outputText2);
+ ASSERT_EQ(resultText3, outputText3);
+ ASSERT_EQ(resultText4, outputText4);
+ ASSERT_EQ(resultText5, outputText5);
}
}
-TEST(CommonFunctions, MonthViewGenerator){
+TEST(CommonFunctions, monthViewGenerator){
- XCCalendarMonthViewGrid MonthView = GenerateMonthGrid(6, 2016);
+ XCCalendarmonthViewGrid monthView = GenerateMonthGrid(6, 2016);
// First week.
- ASSERT_EQ(30, MonthView.WeekList[0].DayList[0].Day);
- ASSERT_EQ(5, MonthView.WeekList[0].DayList[0].Month);
- ASSERT_EQ(2016, MonthView.WeekList[0].DayList[0].Year);
- ASSERT_EQ(false, MonthView.WeekList[0].DayList[0].IsInMonth);
-
- ASSERT_EQ(31, MonthView.WeekList[0].DayList[1].Day);
- ASSERT_EQ(5, MonthView.WeekList[0].DayList[1].Month);
- ASSERT_EQ(2016, MonthView.WeekList[0].DayList[1].Year);
- ASSERT_EQ(false, MonthView.WeekList[0].DayList[1].IsInMonth);
-
- ASSERT_EQ(1, MonthView.WeekList[0].DayList[2].Day);
- ASSERT_EQ(6, MonthView.WeekList[0].DayList[2].Month);
- ASSERT_EQ(2016, MonthView.WeekList[0].DayList[2].Year);
- ASSERT_EQ(true, MonthView.WeekList[0].DayList[2].IsInMonth);
-
- ASSERT_EQ(2, MonthView.WeekList[0].DayList[3].Day);
- ASSERT_EQ(6, MonthView.WeekList[0].DayList[3].Month);
- ASSERT_EQ(2016, MonthView.WeekList[0].DayList[3].Year);
- ASSERT_EQ(true, MonthView.WeekList[0].DayList[3].IsInMonth);
-
- ASSERT_EQ(3, MonthView.WeekList[0].DayList[4].Day);
- ASSERT_EQ(6, MonthView.WeekList[0].DayList[4].Month);
- ASSERT_EQ(2016, MonthView.WeekList[0].DayList[4].Year);
- ASSERT_EQ(true, MonthView.WeekList[0].DayList[4].IsInMonth);
-
- ASSERT_EQ(4, MonthView.WeekList[0].DayList[5].Day);
- ASSERT_EQ(6, MonthView.WeekList[0].DayList[5].Month);
- ASSERT_EQ(2016, MonthView.WeekList[0].DayList[5].Year);
- ASSERT_EQ(true, MonthView.WeekList[0].DayList[5].IsInMonth);
-
- ASSERT_EQ(5, MonthView.WeekList[0].DayList[6].Day);
- ASSERT_EQ(6, MonthView.WeekList[0].DayList[6].Month);
- ASSERT_EQ(2016, MonthView.WeekList[0].DayList[6].Year);
- ASSERT_EQ(true, MonthView.WeekList[0].DayList[6].IsInMonth);
+ ASSERT_EQ(30, monthView.weekList[0].dayList[0].day);
+ ASSERT_EQ(5, monthView.weekList[0].dayList[0].month);
+ ASSERT_EQ(2016, monthView.weekList[0].dayList[0].year);
+ ASSERT_EQ(false, monthView.weekList[0].dayList[0].isInMonth);
+
+ ASSERT_EQ(31, monthView.weekList[0].dayList[1].day);
+ ASSERT_EQ(5, monthView.weekList[0].dayList[1].month);
+ ASSERT_EQ(2016, monthView.weekList[0].dayList[1].year);
+ ASSERT_EQ(false, monthView.weekList[0].dayList[1].isInMonth);
+
+ ASSERT_EQ(1, monthView.weekList[0].dayList[2].day);
+ ASSERT_EQ(6, monthView.weekList[0].dayList[2].month);
+ ASSERT_EQ(2016, monthView.weekList[0].dayList[2].year);
+ ASSERT_EQ(true, monthView.weekList[0].dayList[2].isInMonth);
+
+ ASSERT_EQ(2, monthView.weekList[0].dayList[3].day);
+ ASSERT_EQ(6, monthView.weekList[0].dayList[3].month);
+ ASSERT_EQ(2016, monthView.weekList[0].dayList[3].year);
+ ASSERT_EQ(true, monthView.weekList[0].dayList[3].isInMonth);
+
+ ASSERT_EQ(3, monthView.weekList[0].dayList[4].day);
+ ASSERT_EQ(6, monthView.weekList[0].dayList[4].month);
+ ASSERT_EQ(2016, monthView.weekList[0].dayList[4].year);
+ ASSERT_EQ(true, monthView.weekList[0].dayList[4].isInMonth);
+
+ ASSERT_EQ(4, monthView.weekList[0].dayList[5].day);
+ ASSERT_EQ(6, monthView.weekList[0].dayList[5].month);
+ ASSERT_EQ(2016, monthView.weekList[0].dayList[5].year);
+ ASSERT_EQ(true, monthView.weekList[0].dayList[5].isInMonth);
+
+ ASSERT_EQ(5, monthView.weekList[0].dayList[6].day);
+ ASSERT_EQ(6, monthView.weekList[0].dayList[6].month);
+ ASSERT_EQ(2016, monthView.weekList[0].dayList[6].year);
+ ASSERT_EQ(true, monthView.weekList[0].dayList[6].isInMonth);
// Second week.
- ASSERT_EQ(6, MonthView.WeekList[1].DayList[0].Day);
- ASSERT_EQ(6, MonthView.WeekList[1].DayList[0].Month);
- ASSERT_EQ(2016, MonthView.WeekList[1].DayList[0].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[0].IsInMonth);
-
- ASSERT_EQ(7, MonthView.WeekList[1].DayList[1].Day);
- ASSERT_EQ(6, MonthView.WeekList[1].DayList[1].Month);
- ASSERT_EQ(2016, MonthView.WeekList[1].DayList[1].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[1].IsInMonth);
-
- ASSERT_EQ(8, MonthView.WeekList[1].DayList[2].Day);
- ASSERT_EQ(6, MonthView.WeekList[1].DayList[2].Month);
- ASSERT_EQ(2016, MonthView.WeekList[1].DayList[2].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[2].IsInMonth);
-
- ASSERT_EQ(9, MonthView.WeekList[1].DayList[3].Day);
- ASSERT_EQ(6, MonthView.WeekList[1].DayList[3].Month);
- ASSERT_EQ(2016, MonthView.WeekList[1].DayList[3].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[3].IsInMonth);
-
- ASSERT_EQ(10, MonthView.WeekList[1].DayList[4].Day);
- ASSERT_EQ(6, MonthView.WeekList[1].DayList[4].Month);
- ASSERT_EQ(2016, MonthView.WeekList[1].DayList[4].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[4].IsInMonth);
-
- ASSERT_EQ(11, MonthView.WeekList[1].DayList[5].Day);
- ASSERT_EQ(6, MonthView.WeekList[1].DayList[5].Month);
- ASSERT_EQ(2016, MonthView.WeekList[1].DayList[5].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[5].IsInMonth);
-
- ASSERT_EQ(12, MonthView.WeekList[1].DayList[6].Day);
- ASSERT_EQ(6, MonthView.WeekList[1].DayList[6].Month);
- ASSERT_EQ(2016, MonthView.WeekList[1].DayList[6].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[6].IsInMonth);
+ ASSERT_EQ(6, monthView.weekList[1].dayList[0].day);
+ ASSERT_EQ(6, monthView.weekList[1].dayList[0].month);
+ ASSERT_EQ(2016, monthView.weekList[1].dayList[0].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[0].isInMonth);
+
+ ASSERT_EQ(7, monthView.weekList[1].dayList[1].day);
+ ASSERT_EQ(6, monthView.weekList[1].dayList[1].month);
+ ASSERT_EQ(2016, monthView.weekList[1].dayList[1].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[1].isInMonth);
+
+ ASSERT_EQ(8, monthView.weekList[1].dayList[2].day);
+ ASSERT_EQ(6, monthView.weekList[1].dayList[2].month);
+ ASSERT_EQ(2016, monthView.weekList[1].dayList[2].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[2].isInMonth);
+
+ ASSERT_EQ(9, monthView.weekList[1].dayList[3].day);
+ ASSERT_EQ(6, monthView.weekList[1].dayList[3].month);
+ ASSERT_EQ(2016, monthView.weekList[1].dayList[3].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[3].isInMonth);
+
+ ASSERT_EQ(10, monthView.weekList[1].dayList[4].day);
+ ASSERT_EQ(6, monthView.weekList[1].dayList[4].month);
+ ASSERT_EQ(2016, monthView.weekList[1].dayList[4].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[4].isInMonth);
+
+ ASSERT_EQ(11, monthView.weekList[1].dayList[5].day);
+ ASSERT_EQ(6, monthView.weekList[1].dayList[5].month);
+ ASSERT_EQ(2016, monthView.weekList[1].dayList[5].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[5].isInMonth);
+
+ ASSERT_EQ(12, monthView.weekList[1].dayList[6].day);
+ ASSERT_EQ(6, monthView.weekList[1].dayList[6].month);
+ ASSERT_EQ(2016, monthView.weekList[1].dayList[6].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[6].isInMonth);
// Third Week.
- ASSERT_EQ(13, MonthView.WeekList[2].DayList[0].Day);
- ASSERT_EQ(6, MonthView.WeekList[2].DayList[0].Month);
- ASSERT_EQ(2016, MonthView.WeekList[2].DayList[0].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[0].IsInMonth);
-
- ASSERT_EQ(14, MonthView.WeekList[2].DayList[1].Day);
- ASSERT_EQ(6, MonthView.WeekList[2].DayList[1].Month);
- ASSERT_EQ(2016, MonthView.WeekList[2].DayList[1].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[1].IsInMonth);
-
- ASSERT_EQ(15, MonthView.WeekList[2].DayList[2].Day);
- ASSERT_EQ(6, MonthView.WeekList[2].DayList[2].Month);
- ASSERT_EQ(2016, MonthView.WeekList[2].DayList[2].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[2].IsInMonth);
-
- ASSERT_EQ(16, MonthView.WeekList[2].DayList[3].Day);
- ASSERT_EQ(6, MonthView.WeekList[2].DayList[3].Month);
- ASSERT_EQ(2016, MonthView.WeekList[2].DayList[3].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[3].IsInMonth);
-
- ASSERT_EQ(17, MonthView.WeekList[2].DayList[4].Day);
- ASSERT_EQ(6, MonthView.WeekList[2].DayList[4].Month);
- ASSERT_EQ(2016, MonthView.WeekList[2].DayList[4].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[4].IsInMonth);
-
- ASSERT_EQ(18, MonthView.WeekList[2].DayList[5].Day);
- ASSERT_EQ(6, MonthView.WeekList[2].DayList[5].Month);
- ASSERT_EQ(2016, MonthView.WeekList[2].DayList[5].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[5].IsInMonth);
-
- ASSERT_EQ(19, MonthView.WeekList[2].DayList[6].Day);
- ASSERT_EQ(6, MonthView.WeekList[2].DayList[6].Month);
- ASSERT_EQ(2016, MonthView.WeekList[2].DayList[6].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[6].IsInMonth);
+ ASSERT_EQ(13, monthView.weekList[2].dayList[0].day);
+ ASSERT_EQ(6, monthView.weekList[2].dayList[0].month);
+ ASSERT_EQ(2016, monthView.weekList[2].dayList[0].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[0].isInMonth);
+
+ ASSERT_EQ(14, monthView.weekList[2].dayList[1].day);
+ ASSERT_EQ(6, monthView.weekList[2].dayList[1].month);
+ ASSERT_EQ(2016, monthView.weekList[2].dayList[1].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[1].isInMonth);
+
+ ASSERT_EQ(15, monthView.weekList[2].dayList[2].day);
+ ASSERT_EQ(6, monthView.weekList[2].dayList[2].month);
+ ASSERT_EQ(2016, monthView.weekList[2].dayList[2].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[2].isInMonth);
+
+ ASSERT_EQ(16, monthView.weekList[2].dayList[3].day);
+ ASSERT_EQ(6, monthView.weekList[2].dayList[3].month);
+ ASSERT_EQ(2016, monthView.weekList[2].dayList[3].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[3].isInMonth);
+
+ ASSERT_EQ(17, monthView.weekList[2].dayList[4].day);
+ ASSERT_EQ(6, monthView.weekList[2].dayList[4].month);
+ ASSERT_EQ(2016, monthView.weekList[2].dayList[4].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[4].isInMonth);
+
+ ASSERT_EQ(18, monthView.weekList[2].dayList[5].day);
+ ASSERT_EQ(6, monthView.weekList[2].dayList[5].month);
+ ASSERT_EQ(2016, monthView.weekList[2].dayList[5].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[5].isInMonth);
+
+ ASSERT_EQ(19, monthView.weekList[2].dayList[6].day);
+ ASSERT_EQ(6, monthView.weekList[2].dayList[6].month);
+ ASSERT_EQ(2016, monthView.weekList[2].dayList[6].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[6].isInMonth);
// Fourth week.
- ASSERT_EQ(20, MonthView.WeekList[3].DayList[0].Day);
- ASSERT_EQ(6, MonthView.WeekList[3].DayList[0].Month);
- ASSERT_EQ(2016, MonthView.WeekList[3].DayList[0].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[0].IsInMonth);
-
- ASSERT_EQ(21, MonthView.WeekList[3].DayList[1].Day);
- ASSERT_EQ(6, MonthView.WeekList[3].DayList[1].Month);
- ASSERT_EQ(2016, MonthView.WeekList[3].DayList[1].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[1].IsInMonth);
-
- ASSERT_EQ(22, MonthView.WeekList[3].DayList[2].Day);
- ASSERT_EQ(6, MonthView.WeekList[3].DayList[2].Month);
- ASSERT_EQ(2016, MonthView.WeekList[3].DayList[2].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[2].IsInMonth);
-
- ASSERT_EQ(23, MonthView.WeekList[3].DayList[3].Day);
- ASSERT_EQ(6, MonthView.WeekList[3].DayList[3].Month);
- ASSERT_EQ(2016, MonthView.WeekList[3].DayList[3].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[3].IsInMonth);
-
- ASSERT_EQ(24, MonthView.WeekList[3].DayList[4].Day);
- ASSERT_EQ(6, MonthView.WeekList[3].DayList[4].Month);
- ASSERT_EQ(2016, MonthView.WeekList[3].DayList[4].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[4].IsInMonth);
-
- ASSERT_EQ(25, MonthView.WeekList[3].DayList[5].Day);
- ASSERT_EQ(6, MonthView.WeekList[3].DayList[5].Month);
- ASSERT_EQ(2016, MonthView.WeekList[3].DayList[5].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[5].IsInMonth);
-
- ASSERT_EQ(26, MonthView.WeekList[3].DayList[6].Day);
- ASSERT_EQ(6, MonthView.WeekList[3].DayList[6].Month);
- ASSERT_EQ(2016, MonthView.WeekList[3].DayList[6].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[6].IsInMonth);
+ ASSERT_EQ(20, monthView.weekList[3].dayList[0].day);
+ ASSERT_EQ(6, monthView.weekList[3].dayList[0].month);
+ ASSERT_EQ(2016, monthView.weekList[3].dayList[0].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[0].isInMonth);
+
+ ASSERT_EQ(21, monthView.weekList[3].dayList[1].day);
+ ASSERT_EQ(6, monthView.weekList[3].dayList[1].month);
+ ASSERT_EQ(2016, monthView.weekList[3].dayList[1].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[1].isInMonth);
+
+ ASSERT_EQ(22, monthView.weekList[3].dayList[2].day);
+ ASSERT_EQ(6, monthView.weekList[3].dayList[2].month);
+ ASSERT_EQ(2016, monthView.weekList[3].dayList[2].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[2].isInMonth);
+
+ ASSERT_EQ(23, monthView.weekList[3].dayList[3].day);
+ ASSERT_EQ(6, monthView.weekList[3].dayList[3].month);
+ ASSERT_EQ(2016, monthView.weekList[3].dayList[3].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[3].isInMonth);
+
+ ASSERT_EQ(24, monthView.weekList[3].dayList[4].day);
+ ASSERT_EQ(6, monthView.weekList[3].dayList[4].month);
+ ASSERT_EQ(2016, monthView.weekList[3].dayList[4].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[4].isInMonth);
+
+ ASSERT_EQ(25, monthView.weekList[3].dayList[5].day);
+ ASSERT_EQ(6, monthView.weekList[3].dayList[5].month);
+ ASSERT_EQ(2016, monthView.weekList[3].dayList[5].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[5].isInMonth);
+
+ ASSERT_EQ(26, monthView.weekList[3].dayList[6].day);
+ ASSERT_EQ(6, monthView.weekList[3].dayList[6].month);
+ ASSERT_EQ(2016, monthView.weekList[3].dayList[6].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[6].isInMonth);
// Fifth week.
- ASSERT_EQ(27, MonthView.WeekList[4].DayList[0].Day);
- ASSERT_EQ(6, MonthView.WeekList[4].DayList[0].Month);
- ASSERT_EQ(2016, MonthView.WeekList[4].DayList[0].Year);
- ASSERT_EQ(true, MonthView.WeekList[4].DayList[0].IsInMonth);
-
- ASSERT_EQ(28, MonthView.WeekList[4].DayList[1].Day);
- ASSERT_EQ(6, MonthView.WeekList[4].DayList[1].Month);
- ASSERT_EQ(2016, MonthView.WeekList[4].DayList[1].Year);
- ASSERT_EQ(true, MonthView.WeekList[4].DayList[1].IsInMonth);
-
- ASSERT_EQ(29, MonthView.WeekList[4].DayList[2].Day);
- ASSERT_EQ(6, MonthView.WeekList[4].DayList[2].Month);
- ASSERT_EQ(2016, MonthView.WeekList[4].DayList[2].Year);
- ASSERT_EQ(true, MonthView.WeekList[4].DayList[2].IsInMonth);
-
- ASSERT_EQ(30, MonthView.WeekList[4].DayList[3].Day);
- ASSERT_EQ(6, MonthView.WeekList[4].DayList[3].Month);
- ASSERT_EQ(2016, MonthView.WeekList[4].DayList[3].Year);
- ASSERT_EQ(true, MonthView.WeekList[4].DayList[3].IsInMonth);
-
- ASSERT_EQ(1, MonthView.WeekList[4].DayList[4].Day);
- ASSERT_EQ(7, MonthView.WeekList[4].DayList[4].Month);
- ASSERT_EQ(2016, MonthView.WeekList[4].DayList[4].Year);
- ASSERT_EQ(false, MonthView.WeekList[4].DayList[4].IsInMonth);
-
- ASSERT_EQ(2, MonthView.WeekList[4].DayList[5].Day);
- ASSERT_EQ(7, MonthView.WeekList[4].DayList[5].Month);
- ASSERT_EQ(2016, MonthView.WeekList[4].DayList[5].Year);
- ASSERT_EQ(false, MonthView.WeekList[4].DayList[5].IsInMonth);
-
- ASSERT_EQ(3, MonthView.WeekList[4].DayList[6].Day);
- ASSERT_EQ(7, MonthView.WeekList[4].DayList[6].Month);
- ASSERT_EQ(2016, MonthView.WeekList[4].DayList[6].Year);
- ASSERT_EQ(false, MonthView.WeekList[4].DayList[6].IsInMonth);
+ ASSERT_EQ(27, monthView.weekList[4].dayList[0].day);
+ ASSERT_EQ(6, monthView.weekList[4].dayList[0].month);
+ ASSERT_EQ(2016, monthView.weekList[4].dayList[0].year);
+ ASSERT_EQ(true, monthView.weekList[4].dayList[0].isInMonth);
+
+ ASSERT_EQ(28, monthView.weekList[4].dayList[1].day);
+ ASSERT_EQ(6, monthView.weekList[4].dayList[1].month);
+ ASSERT_EQ(2016, monthView.weekList[4].dayList[1].year);
+ ASSERT_EQ(true, monthView.weekList[4].dayList[1].isInMonth);
+
+ ASSERT_EQ(29, monthView.weekList[4].dayList[2].day);
+ ASSERT_EQ(6, monthView.weekList[4].dayList[2].month);
+ ASSERT_EQ(2016, monthView.weekList[4].dayList[2].year);
+ ASSERT_EQ(true, monthView.weekList[4].dayList[2].isInMonth);
+
+ ASSERT_EQ(30, monthView.weekList[4].dayList[3].day);
+ ASSERT_EQ(6, monthView.weekList[4].dayList[3].month);
+ ASSERT_EQ(2016, monthView.weekList[4].dayList[3].year);
+ ASSERT_EQ(true, monthView.weekList[4].dayList[3].isInMonth);
+
+ ASSERT_EQ(1, monthView.weekList[4].dayList[4].day);
+ ASSERT_EQ(7, monthView.weekList[4].dayList[4].month);
+ ASSERT_EQ(2016, monthView.weekList[4].dayList[4].year);
+ ASSERT_EQ(false, monthView.weekList[4].dayList[4].isInMonth);
+
+ ASSERT_EQ(2, monthView.weekList[4].dayList[5].day);
+ ASSERT_EQ(7, monthView.weekList[4].dayList[5].month);
+ ASSERT_EQ(2016, monthView.weekList[4].dayList[5].year);
+ ASSERT_EQ(false, monthView.weekList[4].dayList[5].isInMonth);
+
+ ASSERT_EQ(3, monthView.weekList[4].dayList[6].day);
+ ASSERT_EQ(7, monthView.weekList[4].dayList[6].month);
+ ASSERT_EQ(2016, monthView.weekList[4].dayList[6].year);
+ ASSERT_EQ(false, monthView.weekList[4].dayList[6].isInMonth);
// Test February 2016 (leap year).
- MonthView = GenerateMonthGrid(2, 2016);
+ monthView = GenerateMonthGrid(2, 2016);
// First week.
- ASSERT_EQ(1, MonthView.WeekList[0].DayList[0].Day);
- ASSERT_EQ(2, MonthView.WeekList[0].DayList[0].Month);
- ASSERT_EQ(2016, MonthView.WeekList[0].DayList[0].Year);
- ASSERT_EQ(true, MonthView.WeekList[0].DayList[0].IsInMonth);
-
- ASSERT_EQ(2, MonthView.WeekList[0].DayList[1].Day);
- ASSERT_EQ(2, MonthView.WeekList[0].DayList[1].Month);
- ASSERT_EQ(2016, MonthView.WeekList[0].DayList[1].Year);
- ASSERT_EQ(true, MonthView.WeekList[0].DayList[1].IsInMonth);
-
- ASSERT_EQ(3, MonthView.WeekList[0].DayList[2].Day);
- ASSERT_EQ(2, MonthView.WeekList[0].DayList[2].Month);
- ASSERT_EQ(2016, MonthView.WeekList[0].DayList[2].Year);
- ASSERT_EQ(true, MonthView.WeekList[0].DayList[2].IsInMonth);
-
- ASSERT_EQ(4, MonthView.WeekList[0].DayList[3].Day);
- ASSERT_EQ(2, MonthView.WeekList[0].DayList[3].Month);
- ASSERT_EQ(2016, MonthView.WeekList[0].DayList[3].Year);
- ASSERT_EQ(true, MonthView.WeekList[0].DayList[3].IsInMonth);
-
- ASSERT_EQ(5, MonthView.WeekList[0].DayList[4].Day);
- ASSERT_EQ(2, MonthView.WeekList[0].DayList[4].Month);
- ASSERT_EQ(2016, MonthView.WeekList[0].DayList[4].Year);
- ASSERT_EQ(true, MonthView.WeekList[0].DayList[4].IsInMonth);
-
- ASSERT_EQ(6, MonthView.WeekList[0].DayList[5].Day);
- ASSERT_EQ(2, MonthView.WeekList[0].DayList[5].Month);
- ASSERT_EQ(2016, MonthView.WeekList[0].DayList[5].Year);
- ASSERT_EQ(true, MonthView.WeekList[0].DayList[5].IsInMonth);
-
- ASSERT_EQ(7, MonthView.WeekList[0].DayList[6].Day);
- ASSERT_EQ(2, MonthView.WeekList[0].DayList[6].Month);
- ASSERT_EQ(2016, MonthView.WeekList[0].DayList[6].Year);
- ASSERT_EQ(true, MonthView.WeekList[0].DayList[6].IsInMonth);
+ ASSERT_EQ(1, monthView.weekList[0].dayList[0].day);
+ ASSERT_EQ(2, monthView.weekList[0].dayList[0].month);
+ ASSERT_EQ(2016, monthView.weekList[0].dayList[0].year);
+ ASSERT_EQ(true, monthView.weekList[0].dayList[0].isInMonth);
+
+ ASSERT_EQ(2, monthView.weekList[0].dayList[1].day);
+ ASSERT_EQ(2, monthView.weekList[0].dayList[1].month);
+ ASSERT_EQ(2016, monthView.weekList[0].dayList[1].year);
+ ASSERT_EQ(true, monthView.weekList[0].dayList[1].isInMonth);
+
+ ASSERT_EQ(3, monthView.weekList[0].dayList[2].day);
+ ASSERT_EQ(2, monthView.weekList[0].dayList[2].month);
+ ASSERT_EQ(2016, monthView.weekList[0].dayList[2].year);
+ ASSERT_EQ(true, monthView.weekList[0].dayList[2].isInMonth);
+
+ ASSERT_EQ(4, monthView.weekList[0].dayList[3].day);
+ ASSERT_EQ(2, monthView.weekList[0].dayList[3].month);
+ ASSERT_EQ(2016, monthView.weekList[0].dayList[3].year);
+ ASSERT_EQ(true, monthView.weekList[0].dayList[3].isInMonth);
+
+ ASSERT_EQ(5, monthView.weekList[0].dayList[4].day);
+ ASSERT_EQ(2, monthView.weekList[0].dayList[4].month);
+ ASSERT_EQ(2016, monthView.weekList[0].dayList[4].year);
+ ASSERT_EQ(true, monthView.weekList[0].dayList[4].isInMonth);
+
+ ASSERT_EQ(6, monthView.weekList[0].dayList[5].day);
+ ASSERT_EQ(2, monthView.weekList[0].dayList[5].month);
+ ASSERT_EQ(2016, monthView.weekList[0].dayList[5].year);
+ ASSERT_EQ(true, monthView.weekList[0].dayList[5].isInMonth);
+
+ ASSERT_EQ(7, monthView.weekList[0].dayList[6].day);
+ ASSERT_EQ(2, monthView.weekList[0].dayList[6].month);
+ ASSERT_EQ(2016, monthView.weekList[0].dayList[6].year);
+ ASSERT_EQ(true, monthView.weekList[0].dayList[6].isInMonth);
// Second week.
- ASSERT_EQ(8, MonthView.WeekList[1].DayList[0].Day);
- ASSERT_EQ(2, MonthView.WeekList[1].DayList[0].Month);
- ASSERT_EQ(2016, MonthView.WeekList[1].DayList[0].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[0].IsInMonth);
-
- ASSERT_EQ(9, MonthView.WeekList[1].DayList[1].Day);
- ASSERT_EQ(2, MonthView.WeekList[1].DayList[1].Month);
- ASSERT_EQ(2016, MonthView.WeekList[1].DayList[1].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[1].IsInMonth);
-
- ASSERT_EQ(10, MonthView.WeekList[1].DayList[2].Day);
- ASSERT_EQ(2, MonthView.WeekList[1].DayList[2].Month);
- ASSERT_EQ(2016, MonthView.WeekList[1].DayList[2].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[2].IsInMonth);
-
- ASSERT_EQ(11, MonthView.WeekList[1].DayList[3].Day);
- ASSERT_EQ(2, MonthView.WeekList[1].DayList[3].Month);
- ASSERT_EQ(2016, MonthView.WeekList[1].DayList[3].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[3].IsInMonth);
-
- ASSERT_EQ(12, MonthView.WeekList[1].DayList[4].Day);
- ASSERT_EQ(2, MonthView.WeekList[1].DayList[4].Month);
- ASSERT_EQ(2016, MonthView.WeekList[1].DayList[4].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[4].IsInMonth);
-
- ASSERT_EQ(13, MonthView.WeekList[1].DayList[5].Day);
- ASSERT_EQ(2, MonthView.WeekList[1].DayList[5].Month);
- ASSERT_EQ(2016, MonthView.WeekList[1].DayList[5].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[5].IsInMonth);
-
- ASSERT_EQ(14, MonthView.WeekList[1].DayList[6].Day);
- ASSERT_EQ(2, MonthView.WeekList[1].DayList[6].Month);
- ASSERT_EQ(2016, MonthView.WeekList[1].DayList[6].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[6].IsInMonth);
+ ASSERT_EQ(8, monthView.weekList[1].dayList[0].day);
+ ASSERT_EQ(2, monthView.weekList[1].dayList[0].month);
+ ASSERT_EQ(2016, monthView.weekList[1].dayList[0].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[0].isInMonth);
+
+ ASSERT_EQ(9, monthView.weekList[1].dayList[1].day);
+ ASSERT_EQ(2, monthView.weekList[1].dayList[1].month);
+ ASSERT_EQ(2016, monthView.weekList[1].dayList[1].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[1].isInMonth);
+
+ ASSERT_EQ(10, monthView.weekList[1].dayList[2].day);
+ ASSERT_EQ(2, monthView.weekList[1].dayList[2].month);
+ ASSERT_EQ(2016, monthView.weekList[1].dayList[2].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[2].isInMonth);
+
+ ASSERT_EQ(11, monthView.weekList[1].dayList[3].day);
+ ASSERT_EQ(2, monthView.weekList[1].dayList[3].month);
+ ASSERT_EQ(2016, monthView.weekList[1].dayList[3].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[3].isInMonth);
+
+ ASSERT_EQ(12, monthView.weekList[1].dayList[4].day);
+ ASSERT_EQ(2, monthView.weekList[1].dayList[4].month);
+ ASSERT_EQ(2016, monthView.weekList[1].dayList[4].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[4].isInMonth);
+
+ ASSERT_EQ(13, monthView.weekList[1].dayList[5].day);
+ ASSERT_EQ(2, monthView.weekList[1].dayList[5].month);
+ ASSERT_EQ(2016, monthView.weekList[1].dayList[5].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[5].isInMonth);
+
+ ASSERT_EQ(14, monthView.weekList[1].dayList[6].day);
+ ASSERT_EQ(2, monthView.weekList[1].dayList[6].month);
+ ASSERT_EQ(2016, monthView.weekList[1].dayList[6].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[6].isInMonth);
// Third Week.
- ASSERT_EQ(15, MonthView.WeekList[2].DayList[0].Day);
- ASSERT_EQ(2, MonthView.WeekList[2].DayList[0].Month);
- ASSERT_EQ(2016, MonthView.WeekList[2].DayList[0].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[0].IsInMonth);
-
- ASSERT_EQ(16, MonthView.WeekList[2].DayList[1].Day);
- ASSERT_EQ(2, MonthView.WeekList[2].DayList[1].Month);
- ASSERT_EQ(2016, MonthView.WeekList[2].DayList[1].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[1].IsInMonth);
-
- ASSERT_EQ(17, MonthView.WeekList[2].DayList[2].Day);
- ASSERT_EQ(2, MonthView.WeekList[2].DayList[2].Month);
- ASSERT_EQ(2016, MonthView.WeekList[2].DayList[2].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[2].IsInMonth);
-
- ASSERT_EQ(18, MonthView.WeekList[2].DayList[3].Day);
- ASSERT_EQ(2, MonthView.WeekList[2].DayList[3].Month);
- ASSERT_EQ(2016, MonthView.WeekList[2].DayList[3].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[3].IsInMonth);
-
- ASSERT_EQ(19, MonthView.WeekList[2].DayList[4].Day);
- ASSERT_EQ(2, MonthView.WeekList[2].DayList[4].Month);
- ASSERT_EQ(2016, MonthView.WeekList[2].DayList[4].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[4].IsInMonth);
-
- ASSERT_EQ(20, MonthView.WeekList[2].DayList[5].Day);
- ASSERT_EQ(2, MonthView.WeekList[2].DayList[5].Month);
- ASSERT_EQ(2016, MonthView.WeekList[2].DayList[5].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[5].IsInMonth);
-
- ASSERT_EQ(21, MonthView.WeekList[2].DayList[6].Day);
- ASSERT_EQ(2, MonthView.WeekList[2].DayList[6].Month);
- ASSERT_EQ(2016, MonthView.WeekList[2].DayList[6].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[6].IsInMonth);
+ ASSERT_EQ(15, monthView.weekList[2].dayList[0].day);
+ ASSERT_EQ(2, monthView.weekList[2].dayList[0].month);
+ ASSERT_EQ(2016, monthView.weekList[2].dayList[0].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[0].isInMonth);
+
+ ASSERT_EQ(16, monthView.weekList[2].dayList[1].day);
+ ASSERT_EQ(2, monthView.weekList[2].dayList[1].month);
+ ASSERT_EQ(2016, monthView.weekList[2].dayList[1].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[1].isInMonth);
+
+ ASSERT_EQ(17, monthView.weekList[2].dayList[2].day);
+ ASSERT_EQ(2, monthView.weekList[2].dayList[2].month);
+ ASSERT_EQ(2016, monthView.weekList[2].dayList[2].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[2].isInMonth);
+
+ ASSERT_EQ(18, monthView.weekList[2].dayList[3].day);
+ ASSERT_EQ(2, monthView.weekList[2].dayList[3].month);
+ ASSERT_EQ(2016, monthView.weekList[2].dayList[3].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[3].isInMonth);
+
+ ASSERT_EQ(19, monthView.weekList[2].dayList[4].day);
+ ASSERT_EQ(2, monthView.weekList[2].dayList[4].month);
+ ASSERT_EQ(2016, monthView.weekList[2].dayList[4].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[4].isInMonth);
+
+ ASSERT_EQ(20, monthView.weekList[2].dayList[5].day);
+ ASSERT_EQ(2, monthView.weekList[2].dayList[5].month);
+ ASSERT_EQ(2016, monthView.weekList[2].dayList[5].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[5].isInMonth);
+
+ ASSERT_EQ(21, monthView.weekList[2].dayList[6].day);
+ ASSERT_EQ(2, monthView.weekList[2].dayList[6].month);
+ ASSERT_EQ(2016, monthView.weekList[2].dayList[6].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[6].isInMonth);
// Fourth week.
- ASSERT_EQ(22, MonthView.WeekList[3].DayList[0].Day);
- ASSERT_EQ(2, MonthView.WeekList[3].DayList[0].Month);
- ASSERT_EQ(2016, MonthView.WeekList[3].DayList[0].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[0].IsInMonth);
-
- ASSERT_EQ(23, MonthView.WeekList[3].DayList[1].Day);
- ASSERT_EQ(2, MonthView.WeekList[3].DayList[1].Month);
- ASSERT_EQ(2016, MonthView.WeekList[3].DayList[1].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[1].IsInMonth);
-
- ASSERT_EQ(24, MonthView.WeekList[3].DayList[2].Day);
- ASSERT_EQ(2, MonthView.WeekList[3].DayList[2].Month);
- ASSERT_EQ(2016, MonthView.WeekList[3].DayList[2].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[2].IsInMonth);
-
- ASSERT_EQ(25, MonthView.WeekList[3].DayList[3].Day);
- ASSERT_EQ(2, MonthView.WeekList[3].DayList[3].Month);
- ASSERT_EQ(2016, MonthView.WeekList[3].DayList[3].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[3].IsInMonth);
-
- ASSERT_EQ(26, MonthView.WeekList[3].DayList[4].Day);
- ASSERT_EQ(2, MonthView.WeekList[3].DayList[4].Month);
- ASSERT_EQ(2016, MonthView.WeekList[3].DayList[4].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[4].IsInMonth);
-
- ASSERT_EQ(27, MonthView.WeekList[3].DayList[5].Day);
- ASSERT_EQ(2, MonthView.WeekList[3].DayList[5].Month);
- ASSERT_EQ(2016, MonthView.WeekList[3].DayList[5].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[5].IsInMonth);
-
- ASSERT_EQ(28, MonthView.WeekList[3].DayList[6].Day);
- ASSERT_EQ(2, MonthView.WeekList[3].DayList[6].Month);
- ASSERT_EQ(2016, MonthView.WeekList[3].DayList[6].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[6].IsInMonth);
+ ASSERT_EQ(22, monthView.weekList[3].dayList[0].day);
+ ASSERT_EQ(2, monthView.weekList[3].dayList[0].month);
+ ASSERT_EQ(2016, monthView.weekList[3].dayList[0].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[0].isInMonth);
+
+ ASSERT_EQ(23, monthView.weekList[3].dayList[1].day);
+ ASSERT_EQ(2, monthView.weekList[3].dayList[1].month);
+ ASSERT_EQ(2016, monthView.weekList[3].dayList[1].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[1].isInMonth);
+
+ ASSERT_EQ(24, monthView.weekList[3].dayList[2].day);
+ ASSERT_EQ(2, monthView.weekList[3].dayList[2].month);
+ ASSERT_EQ(2016, monthView.weekList[3].dayList[2].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[2].isInMonth);
+
+ ASSERT_EQ(25, monthView.weekList[3].dayList[3].day);
+ ASSERT_EQ(2, monthView.weekList[3].dayList[3].month);
+ ASSERT_EQ(2016, monthView.weekList[3].dayList[3].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[3].isInMonth);
+
+ ASSERT_EQ(26, monthView.weekList[3].dayList[4].day);
+ ASSERT_EQ(2, monthView.weekList[3].dayList[4].month);
+ ASSERT_EQ(2016, monthView.weekList[3].dayList[4].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[4].isInMonth);
+
+ ASSERT_EQ(27, monthView.weekList[3].dayList[5].day);
+ ASSERT_EQ(2, monthView.weekList[3].dayList[5].month);
+ ASSERT_EQ(2016, monthView.weekList[3].dayList[5].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[5].isInMonth);
+
+ ASSERT_EQ(28, monthView.weekList[3].dayList[6].day);
+ ASSERT_EQ(2, monthView.weekList[3].dayList[6].month);
+ ASSERT_EQ(2016, monthView.weekList[3].dayList[6].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[6].isInMonth);
// Fifth week.
- ASSERT_EQ(29, MonthView.WeekList[4].DayList[0].Day);
- ASSERT_EQ(2, MonthView.WeekList[4].DayList[0].Month);
- ASSERT_EQ(2016, MonthView.WeekList[4].DayList[0].Year);
- ASSERT_EQ(true, MonthView.WeekList[4].DayList[0].IsInMonth);
-
- ASSERT_EQ(1, MonthView.WeekList[4].DayList[1].Day);
- ASSERT_EQ(3, MonthView.WeekList[4].DayList[1].Month);
- ASSERT_EQ(2016, MonthView.WeekList[4].DayList[1].Year);
- ASSERT_EQ(false, MonthView.WeekList[4].DayList[1].IsInMonth);
-
- ASSERT_EQ(2, MonthView.WeekList[4].DayList[2].Day);
- ASSERT_EQ(3, MonthView.WeekList[4].DayList[2].Month);
- ASSERT_EQ(2016, MonthView.WeekList[4].DayList[2].Year);
- ASSERT_EQ(false, MonthView.WeekList[4].DayList[2].IsInMonth);
-
- ASSERT_EQ(3, MonthView.WeekList[4].DayList[3].Day);
- ASSERT_EQ(3, MonthView.WeekList[4].DayList[3].Month);
- ASSERT_EQ(2016, MonthView.WeekList[4].DayList[3].Year);
- ASSERT_EQ(false, MonthView.WeekList[4].DayList[3].IsInMonth);
-
- ASSERT_EQ(4, MonthView.WeekList[4].DayList[4].Day);
- ASSERT_EQ(3, MonthView.WeekList[4].DayList[4].Month);
- ASSERT_EQ(2016, MonthView.WeekList[4].DayList[4].Year);
- ASSERT_EQ(false, MonthView.WeekList[4].DayList[4].IsInMonth);
-
- ASSERT_EQ(5, MonthView.WeekList[4].DayList[5].Day);
- ASSERT_EQ(3, MonthView.WeekList[4].DayList[5].Month);
- ASSERT_EQ(2016, MonthView.WeekList[4].DayList[5].Year);
- ASSERT_EQ(false, MonthView.WeekList[4].DayList[5].IsInMonth);
-
- ASSERT_EQ(6, MonthView.WeekList[4].DayList[6].Day);
- ASSERT_EQ(3, MonthView.WeekList[4].DayList[6].Month);
- ASSERT_EQ(2016, MonthView.WeekList[4].DayList[6].Year);
- ASSERT_EQ(false, MonthView.WeekList[4].DayList[6].IsInMonth);
+ ASSERT_EQ(29, monthView.weekList[4].dayList[0].day);
+ ASSERT_EQ(2, monthView.weekList[4].dayList[0].month);
+ ASSERT_EQ(2016, monthView.weekList[4].dayList[0].year);
+ ASSERT_EQ(true, monthView.weekList[4].dayList[0].isInMonth);
+
+ ASSERT_EQ(1, monthView.weekList[4].dayList[1].day);
+ ASSERT_EQ(3, monthView.weekList[4].dayList[1].month);
+ ASSERT_EQ(2016, monthView.weekList[4].dayList[1].year);
+ ASSERT_EQ(false, monthView.weekList[4].dayList[1].isInMonth);
+
+ ASSERT_EQ(2, monthView.weekList[4].dayList[2].day);
+ ASSERT_EQ(3, monthView.weekList[4].dayList[2].month);
+ ASSERT_EQ(2016, monthView.weekList[4].dayList[2].year);
+ ASSERT_EQ(false, monthView.weekList[4].dayList[2].isInMonth);
+
+ ASSERT_EQ(3, monthView.weekList[4].dayList[3].day);
+ ASSERT_EQ(3, monthView.weekList[4].dayList[3].month);
+ ASSERT_EQ(2016, monthView.weekList[4].dayList[3].year);
+ ASSERT_EQ(false, monthView.weekList[4].dayList[3].isInMonth);
+
+ ASSERT_EQ(4, monthView.weekList[4].dayList[4].day);
+ ASSERT_EQ(3, monthView.weekList[4].dayList[4].month);
+ ASSERT_EQ(2016, monthView.weekList[4].dayList[4].year);
+ ASSERT_EQ(false, monthView.weekList[4].dayList[4].isInMonth);
+
+ ASSERT_EQ(5, monthView.weekList[4].dayList[5].day);
+ ASSERT_EQ(3, monthView.weekList[4].dayList[5].month);
+ ASSERT_EQ(2016, monthView.weekList[4].dayList[5].year);
+ ASSERT_EQ(false, monthView.weekList[4].dayList[5].isInMonth);
+
+ ASSERT_EQ(6, monthView.weekList[4].dayList[6].day);
+ ASSERT_EQ(3, monthView.weekList[4].dayList[6].month);
+ ASSERT_EQ(2016, monthView.weekList[4].dayList[6].year);
+ ASSERT_EQ(false, monthView.weekList[4].dayList[6].isInMonth);
// Generate a month grid for February 2100 (not a leap year).
- MonthView = GenerateMonthGrid(2, 2100);
+ monthView = GenerateMonthGrid(2, 2100);
// First week.
- ASSERT_EQ(4, MonthView.WeekList.size());
+ ASSERT_EQ(4, monthView.weekList.size());
- ASSERT_EQ(1, MonthView.WeekList[0].DayList[0].Day);
- ASSERT_EQ(2, MonthView.WeekList[0].DayList[0].Month);
- ASSERT_EQ(2100, MonthView.WeekList[0].DayList[0].Year);
- ASSERT_EQ(true, MonthView.WeekList[0].DayList[0].IsInMonth);
+ ASSERT_EQ(1, monthView.weekList[0].dayList[0].day);
+ ASSERT_EQ(2, monthView.weekList[0].dayList[0].month);
+ ASSERT_EQ(2100, monthView.weekList[0].dayList[0].year);
+ ASSERT_EQ(true, monthView.weekList[0].dayList[0].isInMonth);
- ASSERT_EQ(2, MonthView.WeekList[0].DayList[1].Day);
- ASSERT_EQ(2, MonthView.WeekList[0].DayList[1].Month);
- ASSERT_EQ(2100, MonthView.WeekList[0].DayList[1].Year);
- ASSERT_EQ(true, MonthView.WeekList[0].DayList[1].IsInMonth);
+ ASSERT_EQ(2, monthView.weekList[0].dayList[1].day);
+ ASSERT_EQ(2, monthView.weekList[0].dayList[1].month);
+ ASSERT_EQ(2100, monthView.weekList[0].dayList[1].year);
+ ASSERT_EQ(true, monthView.weekList[0].dayList[1].isInMonth);
- ASSERT_EQ(3, MonthView.WeekList[0].DayList[2].Day);
- ASSERT_EQ(2, MonthView.WeekList[0].DayList[2].Month);
- ASSERT_EQ(2100, MonthView.WeekList[0].DayList[2].Year);
- ASSERT_EQ(true, MonthView.WeekList[0].DayList[2].IsInMonth);
+ ASSERT_EQ(3, monthView.weekList[0].dayList[2].day);
+ ASSERT_EQ(2, monthView.weekList[0].dayList[2].month);
+ ASSERT_EQ(2100, monthView.weekList[0].dayList[2].year);
+ ASSERT_EQ(true, monthView.weekList[0].dayList[2].isInMonth);
- ASSERT_EQ(4, MonthView.WeekList[0].DayList[3].Day);
- ASSERT_EQ(2, MonthView.WeekList[0].DayList[3].Month);
- ASSERT_EQ(2100, MonthView.WeekList[0].DayList[3].Year);
- ASSERT_EQ(true, MonthView.WeekList[0].DayList[3].IsInMonth);
+ ASSERT_EQ(4, monthView.weekList[0].dayList[3].day);
+ ASSERT_EQ(2, monthView.weekList[0].dayList[3].month);
+ ASSERT_EQ(2100, monthView.weekList[0].dayList[3].year);
+ ASSERT_EQ(true, monthView.weekList[0].dayList[3].isInMonth);
- ASSERT_EQ(5, MonthView.WeekList[0].DayList[4].Day);
- ASSERT_EQ(2, MonthView.WeekList[0].DayList[4].Month);
- ASSERT_EQ(2100, MonthView.WeekList[0].DayList[4].Year);
- ASSERT_EQ(true, MonthView.WeekList[0].DayList[4].IsInMonth);
+ ASSERT_EQ(5, monthView.weekList[0].dayList[4].day);
+ ASSERT_EQ(2, monthView.weekList[0].dayList[4].month);
+ ASSERT_EQ(2100, monthView.weekList[0].dayList[4].year);
+ ASSERT_EQ(true, monthView.weekList[0].dayList[4].isInMonth);
- ASSERT_EQ(6, MonthView.WeekList[0].DayList[5].Day);
- ASSERT_EQ(2, MonthView.WeekList[0].DayList[5].Month);
- ASSERT_EQ(2100, MonthView.WeekList[0].DayList[5].Year);
- ASSERT_EQ(true, MonthView.WeekList[0].DayList[5].IsInMonth);
+ ASSERT_EQ(6, monthView.weekList[0].dayList[5].day);
+ ASSERT_EQ(2, monthView.weekList[0].dayList[5].month);
+ ASSERT_EQ(2100, monthView.weekList[0].dayList[5].year);
+ ASSERT_EQ(true, monthView.weekList[0].dayList[5].isInMonth);
- ASSERT_EQ(7, MonthView.WeekList[0].DayList[6].Day);
- ASSERT_EQ(2, MonthView.WeekList[0].DayList[6].Month);
- ASSERT_EQ(2100, MonthView.WeekList[0].DayList[6].Year);
- ASSERT_EQ(true, MonthView.WeekList[0].DayList[6].IsInMonth);
+ ASSERT_EQ(7, monthView.weekList[0].dayList[6].day);
+ ASSERT_EQ(2, monthView.weekList[0].dayList[6].month);
+ ASSERT_EQ(2100, monthView.weekList[0].dayList[6].year);
+ ASSERT_EQ(true, monthView.weekList[0].dayList[6].isInMonth);
// Second week.
- ASSERT_EQ(8, MonthView.WeekList[1].DayList[0].Day);
- ASSERT_EQ(2, MonthView.WeekList[1].DayList[0].Month);
- ASSERT_EQ(2100, MonthView.WeekList[1].DayList[0].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[0].IsInMonth);
-
- ASSERT_EQ(9, MonthView.WeekList[1].DayList[1].Day);
- ASSERT_EQ(2, MonthView.WeekList[1].DayList[1].Month);
- ASSERT_EQ(2100, MonthView.WeekList[1].DayList[1].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[1].IsInMonth);
-
- ASSERT_EQ(10, MonthView.WeekList[1].DayList[2].Day);
- ASSERT_EQ(2, MonthView.WeekList[1].DayList[2].Month);
- ASSERT_EQ(2100, MonthView.WeekList[1].DayList[2].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[2].IsInMonth);
-
- ASSERT_EQ(11, MonthView.WeekList[1].DayList[3].Day);
- ASSERT_EQ(2, MonthView.WeekList[1].DayList[3].Month);
- ASSERT_EQ(2100, MonthView.WeekList[1].DayList[3].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[3].IsInMonth);
-
- ASSERT_EQ(12, MonthView.WeekList[1].DayList[4].Day);
- ASSERT_EQ(2, MonthView.WeekList[1].DayList[4].Month);
- ASSERT_EQ(2100, MonthView.WeekList[1].DayList[4].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[4].IsInMonth);
-
- ASSERT_EQ(13, MonthView.WeekList[1].DayList[5].Day);
- ASSERT_EQ(2, MonthView.WeekList[1].DayList[5].Month);
- ASSERT_EQ(2100, MonthView.WeekList[1].DayList[5].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[5].IsInMonth);
-
- ASSERT_EQ(14, MonthView.WeekList[1].DayList[6].Day);
- ASSERT_EQ(2, MonthView.WeekList[1].DayList[6].Month);
- ASSERT_EQ(2100, MonthView.WeekList[1].DayList[6].Year);
- ASSERT_EQ(true, MonthView.WeekList[1].DayList[6].IsInMonth);
+ ASSERT_EQ(8, monthView.weekList[1].dayList[0].day);
+ ASSERT_EQ(2, monthView.weekList[1].dayList[0].month);
+ ASSERT_EQ(2100, monthView.weekList[1].dayList[0].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[0].isInMonth);
+
+ ASSERT_EQ(9, monthView.weekList[1].dayList[1].day);
+ ASSERT_EQ(2, monthView.weekList[1].dayList[1].month);
+ ASSERT_EQ(2100, monthView.weekList[1].dayList[1].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[1].isInMonth);
+
+ ASSERT_EQ(10, monthView.weekList[1].dayList[2].day);
+ ASSERT_EQ(2, monthView.weekList[1].dayList[2].month);
+ ASSERT_EQ(2100, monthView.weekList[1].dayList[2].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[2].isInMonth);
+
+ ASSERT_EQ(11, monthView.weekList[1].dayList[3].day);
+ ASSERT_EQ(2, monthView.weekList[1].dayList[3].month);
+ ASSERT_EQ(2100, monthView.weekList[1].dayList[3].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[3].isInMonth);
+
+ ASSERT_EQ(12, monthView.weekList[1].dayList[4].day);
+ ASSERT_EQ(2, monthView.weekList[1].dayList[4].month);
+ ASSERT_EQ(2100, monthView.weekList[1].dayList[4].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[4].isInMonth);
+
+ ASSERT_EQ(13, monthView.weekList[1].dayList[5].day);
+ ASSERT_EQ(2, monthView.weekList[1].dayList[5].month);
+ ASSERT_EQ(2100, monthView.weekList[1].dayList[5].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[5].isInMonth);
+
+ ASSERT_EQ(14, monthView.weekList[1].dayList[6].day);
+ ASSERT_EQ(2, monthView.weekList[1].dayList[6].month);
+ ASSERT_EQ(2100, monthView.weekList[1].dayList[6].year);
+ ASSERT_EQ(true, monthView.weekList[1].dayList[6].isInMonth);
// Third Week.
- ASSERT_EQ(15, MonthView.WeekList[2].DayList[0].Day);
- ASSERT_EQ(2, MonthView.WeekList[2].DayList[0].Month);
- ASSERT_EQ(2100, MonthView.WeekList[2].DayList[0].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[0].IsInMonth);
-
- ASSERT_EQ(16, MonthView.WeekList[2].DayList[1].Day);
- ASSERT_EQ(2, MonthView.WeekList[2].DayList[1].Month);
- ASSERT_EQ(2100, MonthView.WeekList[2].DayList[1].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[1].IsInMonth);
-
- ASSERT_EQ(17, MonthView.WeekList[2].DayList[2].Day);
- ASSERT_EQ(2, MonthView.WeekList[2].DayList[2].Month);
- ASSERT_EQ(2100, MonthView.WeekList[2].DayList[2].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[2].IsInMonth);
-
- ASSERT_EQ(18, MonthView.WeekList[2].DayList[3].Day);
- ASSERT_EQ(2, MonthView.WeekList[2].DayList[3].Month);
- ASSERT_EQ(2100, MonthView.WeekList[2].DayList[3].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[3].IsInMonth);
-
- ASSERT_EQ(19, MonthView.WeekList[2].DayList[4].Day);
- ASSERT_EQ(2, MonthView.WeekList[2].DayList[4].Month);
- ASSERT_EQ(2100, MonthView.WeekList[2].DayList[4].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[4].IsInMonth);
-
- ASSERT_EQ(20, MonthView.WeekList[2].DayList[5].Day);
- ASSERT_EQ(2, MonthView.WeekList[2].DayList[5].Month);
- ASSERT_EQ(2100, MonthView.WeekList[2].DayList[5].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[5].IsInMonth);
-
- ASSERT_EQ(21, MonthView.WeekList[2].DayList[6].Day);
- ASSERT_EQ(2, MonthView.WeekList[2].DayList[6].Month);
- ASSERT_EQ(2100, MonthView.WeekList[2].DayList[6].Year);
- ASSERT_EQ(true, MonthView.WeekList[2].DayList[6].IsInMonth);
+ ASSERT_EQ(15, monthView.weekList[2].dayList[0].day);
+ ASSERT_EQ(2, monthView.weekList[2].dayList[0].month);
+ ASSERT_EQ(2100, monthView.weekList[2].dayList[0].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[0].isInMonth);
+
+ ASSERT_EQ(16, monthView.weekList[2].dayList[1].day);
+ ASSERT_EQ(2, monthView.weekList[2].dayList[1].month);
+ ASSERT_EQ(2100, monthView.weekList[2].dayList[1].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[1].isInMonth);
+
+ ASSERT_EQ(17, monthView.weekList[2].dayList[2].day);
+ ASSERT_EQ(2, monthView.weekList[2].dayList[2].month);
+ ASSERT_EQ(2100, monthView.weekList[2].dayList[2].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[2].isInMonth);
+
+ ASSERT_EQ(18, monthView.weekList[2].dayList[3].day);
+ ASSERT_EQ(2, monthView.weekList[2].dayList[3].month);
+ ASSERT_EQ(2100, monthView.weekList[2].dayList[3].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[3].isInMonth);
+
+ ASSERT_EQ(19, monthView.weekList[2].dayList[4].day);
+ ASSERT_EQ(2, monthView.weekList[2].dayList[4].month);
+ ASSERT_EQ(2100, monthView.weekList[2].dayList[4].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[4].isInMonth);
+
+ ASSERT_EQ(20, monthView.weekList[2].dayList[5].day);
+ ASSERT_EQ(2, monthView.weekList[2].dayList[5].month);
+ ASSERT_EQ(2100, monthView.weekList[2].dayList[5].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[5].isInMonth);
+
+ ASSERT_EQ(21, monthView.weekList[2].dayList[6].day);
+ ASSERT_EQ(2, monthView.weekList[2].dayList[6].month);
+ ASSERT_EQ(2100, monthView.weekList[2].dayList[6].year);
+ ASSERT_EQ(true, monthView.weekList[2].dayList[6].isInMonth);
// Fourth week.
- ASSERT_EQ(22, MonthView.WeekList[3].DayList[0].Day);
- ASSERT_EQ(2, MonthView.WeekList[3].DayList[0].Month);
- ASSERT_EQ(2100, MonthView.WeekList[3].DayList[0].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[0].IsInMonth);
-
- ASSERT_EQ(23, MonthView.WeekList[3].DayList[1].Day);
- ASSERT_EQ(2, MonthView.WeekList[3].DayList[1].Month);
- ASSERT_EQ(2100, MonthView.WeekList[3].DayList[1].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[1].IsInMonth);
-
- ASSERT_EQ(24, MonthView.WeekList[3].DayList[2].Day);
- ASSERT_EQ(2, MonthView.WeekList[3].DayList[2].Month);
- ASSERT_EQ(2100, MonthView.WeekList[3].DayList[2].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[2].IsInMonth);
-
- ASSERT_EQ(25, MonthView.WeekList[3].DayList[3].Day);
- ASSERT_EQ(2, MonthView.WeekList[3].DayList[3].Month);
- ASSERT_EQ(2100, MonthView.WeekList[3].DayList[3].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[3].IsInMonth);
-
- ASSERT_EQ(26, MonthView.WeekList[3].DayList[4].Day);
- ASSERT_EQ(2, MonthView.WeekList[3].DayList[4].Month);
- ASSERT_EQ(2100, MonthView.WeekList[3].DayList[4].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[4].IsInMonth);
-
- ASSERT_EQ(27, MonthView.WeekList[3].DayList[5].Day);
- ASSERT_EQ(2, MonthView.WeekList[3].DayList[5].Month);
- ASSERT_EQ(2100, MonthView.WeekList[3].DayList[5].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[5].IsInMonth);
-
- ASSERT_EQ(28, MonthView.WeekList[3].DayList[6].Day);
- ASSERT_EQ(2, MonthView.WeekList[3].DayList[6].Month);
- ASSERT_EQ(2100, MonthView.WeekList[3].DayList[6].Year);
- ASSERT_EQ(true, MonthView.WeekList[3].DayList[6].IsInMonth);
+ ASSERT_EQ(22, monthView.weekList[3].dayList[0].day);
+ ASSERT_EQ(2, monthView.weekList[3].dayList[0].month);
+ ASSERT_EQ(2100, monthView.weekList[3].dayList[0].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[0].isInMonth);
+
+ ASSERT_EQ(23, monthView.weekList[3].dayList[1].day);
+ ASSERT_EQ(2, monthView.weekList[3].dayList[1].month);
+ ASSERT_EQ(2100, monthView.weekList[3].dayList[1].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[1].isInMonth);
+
+ ASSERT_EQ(24, monthView.weekList[3].dayList[2].day);
+ ASSERT_EQ(2, monthView.weekList[3].dayList[2].month);
+ ASSERT_EQ(2100, monthView.weekList[3].dayList[2].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[2].isInMonth);
+
+ ASSERT_EQ(25, monthView.weekList[3].dayList[3].day);
+ ASSERT_EQ(2, monthView.weekList[3].dayList[3].month);
+ ASSERT_EQ(2100, monthView.weekList[3].dayList[3].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[3].isInMonth);
+
+ ASSERT_EQ(26, monthView.weekList[3].dayList[4].day);
+ ASSERT_EQ(2, monthView.weekList[3].dayList[4].month);
+ ASSERT_EQ(2100, monthView.weekList[3].dayList[4].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[4].isInMonth);
+
+ ASSERT_EQ(27, monthView.weekList[3].dayList[5].day);
+ ASSERT_EQ(2, monthView.weekList[3].dayList[5].month);
+ ASSERT_EQ(2100, monthView.weekList[3].dayList[5].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[5].isInMonth);
+
+ ASSERT_EQ(28, monthView.weekList[3].dayList[6].day);
+ ASSERT_EQ(2, monthView.weekList[3].dayList[6].month);
+ ASSERT_EQ(2100, monthView.weekList[3].dayList[6].year);
+ ASSERT_EQ(true, monthView.weekList[3].dayList[6].isInMonth);
}
\ No newline at end of file
TEST(iCalendarEvent, BasicTests){
- CalendarEventObject TestEvent;
+ CalendarEventObject testEvent;
- ASSERT_EQ(CALENDAROBJECTLOAD_MISSING, TestEvent.LoadFile("iCalendarEvent-Missing.vcf"));
- ASSERT_EQ(CALENDAROBJECTLOAD_CANNOTOPEN, TestEvent.LoadFile("iCalendarEvent-InvalidPermissions.vcf"));
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestEvent.LoadFile("iCalendarEvent-Load1.vcf"));
+ ASSERT_EQ(CALENDAROBJECTLOAD_MISSING, testEvent.LoadFile("iCalendarEvent-Missing.vcf"));
+ ASSERT_EQ(CALENDAROBJECTLOAD_CANNOTOPEN, testEvent.LoadFile("iCalendarEvent-InvalidPermissions.vcf"));
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testEvent.LoadFile("iCalendarEvent-Load1.vcf"));
}
TEST(iCalendarEvent, BaseObjectVerifyTests){
- CalendarEventObject TestEvent;
- TestEvent.LoadFile("iCalendarEvent-Load1.vcf");
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestEvent.ValidBaseObject());
+ CalendarEventObject testEvent;
+ testEvent.LoadFile("iCalendarEvent-Load1.vcf");
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testEvent.ValidBaseObject());
// Tests for METHOD.
- ASSERT_EQ("REQUEST", TestEvent.MethodData);
- ASSERT_EQ("EXAMPLE=DATA", TestEvent.MethodTokens);
+ ASSERT_EQ("REQUEST", testEvent.methodData);
+ ASSERT_EQ("EXAMPLE=DATA", testEvent.methodTokens);
// Tests for CALSCALE.
- ASSERT_EQ("GREGORIAN", TestEvent.CalendarScaleData);
- ASSERT_EQ("MORE=YES", TestEvent.CalendarScaleTokens);
+ ASSERT_EQ("GREGORIAN", testEvent.calendarScaleData);
+ ASSERT_EQ("MORE=YES", testEvent.calendarScaleTokens);
}
TEST(iCalendarEvent, ObjectDataTests){
- CalendarEventObject TestEvent;
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestEvent.LoadFile("iCalendarEvent-Load2.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestEvent.ValidBaseObject());
+ CalendarEventObject testEvent;
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testEvent.LoadFile("iCalendarEvent-Load2.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testEvent.ValidBaseObject());
// Tests for DTSTAMP.
- ASSERT_EQ("20160122T124100Z", TestEvent.DateTimeStampData);
- ASSERT_EQ("OTHER=PARAM", TestEvent.DateTimeStampTokens);
+ ASSERT_EQ("20160122T124100Z", testEvent.dateTimeStampData);
+ ASSERT_EQ("OTHER=PARAM", testEvent.dateTimeStampTokens);
// Tests for UID.
- ASSERT_EQ("b3a16392-ad86-4061-be53-c215af2306e0", TestEvent.UniqueID);
- ASSERT_EQ("UNIQUEPARAM=CERTAINLY;OKAY=MAYBENOT", TestEvent.UniqueIDTokens);
+ ASSERT_EQ("b3a16392-ad86-4061-be53-c215af2306e0", testEvent.uniqueID);
+ ASSERT_EQ("UNIQUEPARAM=CERTAINLY;OKAY=MAYBENOT", testEvent.uniqueIDTokens);
// Tests for DTSTART.
- ASSERT_EQ("20160122T183000Z", TestEvent.DateTimeStartData);
- ASSERT_EQ("DATE-TIME", TestEvent.DateTimeStartDataValue);
- ASSERT_EQ("Europe/Truro", TestEvent.DateTimeStartDataTimeZoneID);
- ASSERT_EQ("PARAMONE=YES;PARAMTWO=NO", TestEvent.DateTimeStartDataTokens);
+ ASSERT_EQ("20160122T183000Z", testEvent.dateTimeStartData);
+ ASSERT_EQ("DATE-TIME", testEvent.dateTimeStartDataValue);
+ ASSERT_EQ("Europe/Truro", testEvent.dateTimeStartDataTimeZoneID);
+ ASSERT_EQ("PARAMONE=YES;PARAMTWO=NO", testEvent.dateTimeStartDataTokens);
// Tests for CLASS.
- ASSERT_EQ("PUBLIC", TestEvent.ClassData);
- ASSERT_EQ("CHOCOLATE=BAR", TestEvent.ClassDataTokens);
+ ASSERT_EQ("PUBLIC", testEvent.classData);
+ ASSERT_EQ("CHOCOLATE=BAR", testEvent.classDataTokens);
// Tests for CREATED.
- ASSERT_EQ("20160123T081100Z", TestEvent.DateTimeCreatedData);
- ASSERT_EQ("CARAMEL=PLEASE", TestEvent.DateTimeCreatedTokens);
+ ASSERT_EQ("20160123T081100Z", testEvent.dateTimeCreatedData);
+ ASSERT_EQ("CARAMEL=PLEASE", testEvent.dateTimeCreatedTokens);
// Tests for DESCRIPTION.
- std::string DescriptionData;
- std::string DescriptionAltRep;
- std::string DescriptionLanguage;
- std::string DescriptionTokens;
+ std::string descriptionData;
+ std::string descriptionAltRep;
+ std::string descriptionLanguage;
+ std::string descriptionTokens;
- if (TestEvent.DescriptionList.begin() != TestEvent.DescriptionList.end()){
- DescriptionData = TestEvent.DescriptionList[0];
+ if (testEvent.descriptionList.begin() != testEvent.descriptionList.end()){
+ DescriptionData = testEvent.descriptionList[0];
}
- if (TestEvent.DescriptionListAltRep.begin() != TestEvent.DescriptionListAltRep.end()){
- DescriptionAltRep = TestEvent.DescriptionListAltRep[0];
+ if (testEvent.descriptionListAltRep.begin() != testEvent.descriptionListAltRep.end()){
+ DescriptionAltRep = testEvent.descriptionListAltRep[0];
}
- if (TestEvent.DescriptionListLanguage.begin() != TestEvent.DescriptionListLanguage.end()){
- DescriptionLanguage = TestEvent.DescriptionListLanguage[0];
+ if (testEvent.descriptionListLanguage.begin() != testEvent.descriptionListLanguage.end()){
+ DescriptionLanguage = testEvent.descriptionListLanguage[0];
}
- if (TestEvent.DescriptionListTokens.begin() != TestEvent.DescriptionListTokens.end()){
- DescriptionTokens = TestEvent.DescriptionListTokens[0];
+ if (testEvent.descriptionListTokens.begin() != testEvent.descriptionListTokens.end()){
+ DescriptionTokens = testEvent.descriptionListTokens[0];
}
- ASSERT_EQ("This is a description of the event.", DescriptionData);
- ASSERT_EQ("null:nodata", DescriptionAltRep);
- ASSERT_EQ("kw", DescriptionLanguage);
- ASSERT_EQ("EXAMPLE=TOKEN;MOREDATA=YES", DescriptionTokens);
+ ASSERT_EQ("This is a description of the event.", descriptionData);
+ ASSERT_EQ("null:nodata", descriptionAltRep);
+ ASSERT_EQ("kw", descriptionLanguage);
+ ASSERT_EQ("EXAMPLE=TOKEN;MOREDATA=YES", descriptionTokens);
// Tests for GEO.
- ASSERT_EQ("5.0;5.0", TestEvent.GeographicData);
- ASSERT_EQ("EXAMPLE=MEEP", TestEvent.GeographicTokens);
+ ASSERT_EQ("5.0;5.0", testEvent.geographicData);
+ ASSERT_EQ("EXAMPLE=MEEP", testEvent.geographicTokens);
// Tests for LAST-MODIFIED.
- ASSERT_EQ("20160124T093000Z", TestEvent.LastModifiedData);
- ASSERT_EQ("FUTURE=ODD", TestEvent.LastModifiedTokens);
+ ASSERT_EQ("20160124T093000Z", testEvent.lastModifiedData);
+ ASSERT_EQ("FUTURE=ODD", testEvent.lastModifiedTokens);
// Tests for LOCATION.
- ASSERT_EQ("The Basement, Truro", TestEvent.LocationData);
- ASSERT_EQ("null:nodata", TestEvent.LocationDataAltRep);
- ASSERT_EQ("kw", TestEvent.LocationDataLanguage);
- ASSERT_EQ("EXACT=NO", TestEvent.LocationDataTokens);
+ ASSERT_EQ("The Basement, Truro", testEvent.locationData);
+ ASSERT_EQ("null:nodata", testEvent.locationDataAltRep);
+ ASSERT_EQ("kw", testEvent.locationDataLanguage);
+ ASSERT_EQ("EXACT=NO", testEvent.locationDataTokens);
// Tests for ORGANIZER.
- ASSERT_EQ("mailto:organiser@example.com", TestEvent.OrganiserData);
- ASSERT_EQ("ExampleOrganiser", TestEvent.OrganiserDataCommonName);
- ASSERT_EQ("null:nodata", TestEvent.OrganiserDataDirectoryEntry);
- ASSERT_EQ("mailto:organiser.noreply@example.com", TestEvent.OrganiserDataSentByParam);
- ASSERT_EQ("kw", TestEvent.OrganiserDataLanguage);
- ASSERT_EQ("HAPPY=DAYS", TestEvent.OrganiserDataTokens);
+ ASSERT_EQ("mailto:organiser@example.com", testEvent.organiserData);
+ ASSERT_EQ("ExampleOrganiser", testEvent.organiserDataCommonName);
+ ASSERT_EQ("null:nodata", testEvent.organiserDataDirectoryEntry);
+ ASSERT_EQ("mailto:organiser.noreply@example.com", testEvent.organiserDataSentByParam);
+ ASSERT_EQ("kw", testEvent.organiserDataLanguage);
+ ASSERT_EQ("HAPPY=DAYS", testEvent.organiserDataTokens);
// Tests for PRIORITY.
- ASSERT_EQ(5, TestEvent.PriorityData);
- ASSERT_EQ("STATUS=DEFAULT", TestEvent.PriorityTokens);
+ ASSERT_EQ(5, testEvent.priorityData);
+ ASSERT_EQ("STATUS=DEFAULT", testEvent.priorityTokens);
// Tests for SEQUENCE.
- ASSERT_EQ(3, TestEvent.SequenceData);
- ASSERT_EQ("TEST=YAY", TestEvent.SequenceTokens);
+ ASSERT_EQ(3, testEvent.sequenceData);
+ ASSERT_EQ("TEST=YAY", testEvent.sequenceTokens);
// Tests for STATUS.
- ASSERT_EQ("2.0;Success", TestEvent.StatusData);
- ASSERT_EQ("kw", TestEvent.StatusLanguage);
- ASSERT_EQ("FAVOURITE=RICHTEA;NOTLIKE=UNKNOWN", TestEvent.StatusTokens);
+ ASSERT_EQ("2.0;Success", testEvent.statusData);
+ ASSERT_EQ("kw", testEvent.statusLanguage);
+ ASSERT_EQ("FAVOURITE=RICHTEA;NOTLIKE=UNKNOWN", testEvent.statusTokens);
// Tests for SUMMARY.
- ASSERT_EQ("A summary of the event.", TestEvent.SummaryData);
- ASSERT_EQ("null:nodata", TestEvent.SummaryDataAltRep);
- ASSERT_EQ("kw", TestEvent.SummaryDataLanguage);
- ASSERT_EQ("FAVOURITE=TOFU;NOTLIKE=NONE", TestEvent.SummaryDataTokens);
+ ASSERT_EQ("A summary of the event.", testEvent.summaryData);
+ ASSERT_EQ("null:nodata", testEvent.summaryDataAltRep);
+ ASSERT_EQ("kw", testEvent.summaryDataLanguage);
+ ASSERT_EQ("FAVOURITE=TOFU;NOTLIKE=NONE", testEvent.summaryDataTokens);
// Tests for TRANSP.
- ASSERT_EQ("TRANSPARENT", TestEvent.TimeTransparencyData);
- ASSERT_EQ("OPAQUE=NOTYET", TestEvent.TimeTransparencyDataTokens);
+ ASSERT_EQ("TRANSPARENT", testEvent.timeTransparencyData);
+ ASSERT_EQ("OPAQUE=NOTYET", testEvent.timeTransparencyDataTokens);
// Tests for URL.
- ASSERT_EQ("http://www.example.com/", TestEvent.URLData);
- ASSERT_EQ("EXTERNAL=YES", TestEvent.URLDataTokens);
+ ASSERT_EQ("http://www.example.com/", testEvent.urlData);
+ ASSERT_EQ("EXTERNAL=YES", testEvent.urlDataTokens);
// Tests for RECURRENCE-ID.
- ASSERT_EQ("20160124", TestEvent.RecurranceIDData);
- ASSERT_EQ("Europe/Truro", TestEvent.RecurranceIDDataTimeZoneParam);
- ASSERT_EQ("THISANDFUTURE", TestEvent.RecurranceIDDataRangeParam);
- ASSERT_EQ("DATE", TestEvent.RecurranceIDDataValue);
- ASSERT_EQ("EXAMPLE=DATA", TestEvent.RecurranceIDDataTokens);
+ ASSERT_EQ("20160124", testEvent.recurranceIDData);
+ ASSERT_EQ("Europe/Truro", testEvent.recurranceIDDataTimeZoneParam);
+ ASSERT_EQ("THISANDFUTURE", testEvent.recurranceIDDataRangeParam);
+ ASSERT_EQ("DATE", testEvent.recurranceIDDataValue);
+ ASSERT_EQ("EXAMPLE=DATA", testEvent.recurranceIDDataTokens);
// Tests for RRULE.
- ASSERT_EQ("FREQ=DAILY;COUNT=10", TestEvent.RecurranceRuleData);
- ASSERT_EQ("TEST=DATA", TestEvent.RecurranceRuleDataTokens);
+ ASSERT_EQ("FREQ=DAILY;COUNT=10", testEvent.recurranceRuleData);
+ ASSERT_EQ("TEST=DATA", testEvent.recurranceRuleDataTokens);
// Tests for DTEND.
- ASSERT_EQ("20160124T183000Z", TestEvent.DateTimeEndData);
- ASSERT_EQ("DATE-TIME", TestEvent.DateTimeEndDataValue);
- ASSERT_EQ("Europe/Truro", TestEvent.DateTimeEndDataTimeZoneID);
- ASSERT_EQ("PARAMFOUR=YES;PARAMTHREE=NO", TestEvent.DateTimeEndDataTokens);
+ ASSERT_EQ("20160124T183000Z", testEvent.dateTimeEndData);
+ ASSERT_EQ("DATE-TIME", testEvent.dateTimeEndDataValue);
+ ASSERT_EQ("Europe/Truro", testEvent.dateTimeEndDataTimeZoneID);
+ ASSERT_EQ("PARAMFOUR=YES;PARAMTHREE=NO", testEvent.dateTimeEndDataTokens);
// Tests for DURATION. (Done in another file called
// iCalendarEvent-Load3.vcf).
- CalendarEventObject TestEvent2;
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestEvent2.LoadFile("iCalendarEvent-Load3.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestEvent2.ValidBaseObject());
+ CalendarEventObject testEvent2;
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testEvent2.LoadFile("iCalendarEvent-Load3.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testEvent2.ValidBaseObject());
- ASSERT_EQ("PT1H", TestEvent2.DurationData);
- ASSERT_EQ("TEST=EXAMPLE", TestEvent2.DurationDataTokens);
+ ASSERT_EQ("PT1H", testEvent2.DurationData);
+ ASSERT_EQ("TEST=EXAMPLE", testEvent2.DurationDataTokens);
// Tests for ATTACH. First ATTACH property.
- std::string AttachData;
- std::string AttachDataFormatType;
- std::string AttachDataValue;
- std::string AttachDataEncoding;
- std::string AttachDataTokens;
+ std::string attachData;
+ std::string attachDataFormatType;
+ std::string attachDataValue;
+ std::string attachDataEncoding;
+ std::string attachDataTokens;
- if (TestEvent.AttachList.begin() != TestEvent.AttachList.end()){
+ if (testEvent.attachList.begin() != testEvent.attachList.end()){
- AttachData = TestEvent.AttachList[0];
+ attachData = testEvent.attachList[0];
}
- if (TestEvent.AttachListFormatType.begin() != TestEvent.AttachListFormatType.end()){
+ if (testEvent.attachListFormatType.begin() != testEvent.attachListFormatType.end()){
- AttachDataFormatType = TestEvent.AttachListFormatType[0];
+ attachDataFormatType = testEvent.attachListFormatType[0];
}
- ASSERT_EQ("http://www.example.com/", AttachData);
- ASSERT_EQ("application/internet-shortcut", AttachDataFormatType);
+ ASSERT_EQ("http://www.example.com/", attachData);
+ ASSERT_EQ("application/internet-shortcut", attachDataFormatType);
// Second ATTACH property.
- AttachData.clear();
- AttachDataFormatType.clear();
- AttachDataValue.clear();
- AttachDataEncoding.clear();
+ attachData.clear();
+ attachDataFormatType.clear();
+ attachDataValue.clear();
+ attachDataEncoding.clear();
- if (TestEvent.AttachList.size() > 1){
+ if (testEvent.attachList.size() > 1){
- AttachData = TestEvent.AttachList[1];
+ attachData = testEvent.attachList[1];
}
- if (TestEvent.AttachListFormatType.size() > 1){
+ if (testEvent.attachListFormatType.size() > 1){
- AttachDataFormatType = TestEvent.AttachListFormatType[1];
+ attachDataFormatType = testEvent.attachListFormatType[1];
}
- ASSERT_EQ("http://www.example.com/page2.html", AttachData);
- ASSERT_EQ("application/internet-shortcut", AttachDataFormatType);
+ ASSERT_EQ("http://www.example.com/page2.html", attachData);
+ ASSERT_EQ("application/internet-shortcut", attachDataFormatType);
// Third ATTACH property.
- AttachData.clear();
- AttachDataFormatType.clear();
- AttachDataValue.clear();
- AttachDataEncoding.clear();
- AttachDataTokens.clear();
+ attachData.clear();
+ attachDataFormatType.clear();
+ attachDataValue.clear();
+ attachDataEncoding.clear();
+ attachDataTokens.clear();
- if (TestEvent.AttachList.size() > 2){
+ if (testEvent.attachList.size() > 2){
- AttachData = TestEvent.AttachList[2];
+ attachData = testEvent.attachList[2];
}
- if (TestEvent.AttachListFormatType.size() > 2){
+ if (testEvent.attachListFormatType.size() > 2){
- AttachDataFormatType = TestEvent.AttachListFormatType[2];
+ attachDataFormatType = testEvent.attachListFormatType[2];
}
- if (TestEvent.AttachListValue.size() > 2){
+ if (testEvent.AttachListValue.size() > 2){
- AttachDataValue = TestEvent.AttachListValue[2];
+ attachDataValue = testEvent.attachListValue[2];
}
- if (TestEvent.AttachListFormatType.size() > 2){
+ if (testEvent.AttachListFormatType.size() > 2){
- AttachDataEncoding = TestEvent.AttachListEncoding[2];
+ attachDataEncoding = testEvent.attachListEncoding[2];
}
- if (TestEvent.AttachListTokens.size() > 2){
+ if (testEvent.AttachListTokens.size() > 2){
- AttachDataTokens = TestEvent.AttachListTokens[2];
+ attachDataTokens = testEvent.attachListTokens[2];
}
- ASSERT_EQ("VGhpcyBpcyBhbiBleGFtcGxlIGZpbGU=", AttachData);
- ASSERT_EQ("text/plain", AttachDataFormatType);
- ASSERT_EQ("BASE64", AttachDataEncoding);
- ASSERT_EQ("BINARY", AttachDataValue);
- ASSERT_EQ("STUPID=EXAMPLE", AttachDataTokens);
+ ASSERT_EQ("VGhpcyBpcyBhbiBleGFtcGxlIGZpbGU=", attachData);
+ ASSERT_EQ("text/plain", attachDataFormatType);
+ ASSERT_EQ("BASE64", attachDataEncoding);
+ ASSERT_EQ("BINARY", attachDataValue);
+ ASSERT_EQ("STUPID=EXAMPLE", attachDataTokens);
// Tests for ATTENDEE. First ATTENDEE property.
- std::string AttendeeDataMember;
- std::string AttendeeDataDelegatedFrom;
- std::string AttendeeDataDelegatedTo;
- std::string AttendeeDataRole;
- std::string AttendeeDataRSVP;
- std::string AttendeeDataDirectoryEntry;
- std::string AttendeeDataSentBy;
- std::string AttendeeDataCommonName;
- std::string AttendeeDataCalendarUserType;
- std::string AttendeeDataParticipationStatus;
- std::string AttendeeDataLanguage;
- std::string AttendeeDataTokens;
- std::string AttendeeData;
+ std::string attendeeDataMember;
+ std::string attendeeDataDelegatedFrom;
+ std::string attendeeDataDelegatedTo;
+ std::string attendeeDataRole;
+ std::string attendeeDataRSVP;
+ std::string attendeeDataDirectoryEntry;
+ std::string attendeeDataSentBy;
+ std::string attendeeDataCommonName;
+ std::string attendeeDataCalendarUserType;
+ std::string attendeeDataParticipationStatus;
+ std::string attendeeDataLanguage;
+ std::string attendeeDataTokens;
+ std::string attendeeData;
- if (TestEvent.AttendeeList.begin() != TestEvent.AttendeeList.end()){
+ if (testEvent.attendeeList.begin() != testEvent.attendeeList.end()){
- AttendeeData = TestEvent.AttendeeList[0];
+ attendeeData = testEvent.attendeeList[0];
}
- ASSERT_EQ("Attendee One", AttendeeData);
+ ASSERT_EQ("Attendee One", attendeeData);
// Second ATTENDEE property.
- AttendeeData.clear();
+ attendeeData.clear();
- if (TestEvent.AttendeeList.size() > 1){
+ if (testEvent.attendeeList.size() > 1){
- AttendeeData = TestEvent.AttendeeList[1];
+ attendeeData = testEvent.attendeeList[1];
}
- if (TestEvent.AttendeeList.size() > 1){
+ if (testEvent.attendeeList.size() > 1){
- AttendeeDataDelegatedFrom = TestEvent.AttendeeListDelegatedFrom[1];
+ attendeeDataDelegatedFrom = testEvent.attendeeListDelegatedFrom[1];
}
- if (TestEvent.AttendeeList.size() > 1){
+ if (testEvent.attendeeList.size() > 1){
- AttendeeDataDelegatedTo = TestEvent.AttendeeListDelegatedTo[1];
+ attendeeDataDelegatedTo = testEvent.attendeeListDelegatedTo[1];
}
- if (TestEvent.AttendeeList.size() > 1){
+ if (testEvent.attendeeList.size() > 1){
- AttendeeDataRole = TestEvent.AttendeeListRole[1];
+ attendeeDataRole = testEvent.attendeeListRole[1];
}
- if (TestEvent.AttendeeList.size() > 1){
+ if (testEvent.attendeeList.size() > 1){
- AttendeeDataRSVP = TestEvent.AttendeeListRSVP[1];
+ attendeeDataRSVP = testEvent.attendeeListRSVP[1];
}
- ASSERT_EQ("Attendee Two", AttendeeData);
- ASSERT_EQ("mailto:delegated.from@example.com", AttendeeDataDelegatedFrom);
- ASSERT_EQ("mailto:delegated.to@example.com", AttendeeDataDelegatedTo);
- ASSERT_EQ("CHAIR", AttendeeDataRole);
- ASSERT_EQ("TRUE", AttendeeDataRSVP);
+ ASSERT_EQ("Attendee Two", attendeeData);
+ ASSERT_EQ("mailto:delegated.from@example.com", attendeeDataDelegatedFrom);
+ ASSERT_EQ("mailto:delegated.to@example.com", attendeeDataDelegatedTo);
+ ASSERT_EQ("CHAIR", attendeeDataRole);
+ ASSERT_EQ("TRUE", attendeeDataRSVP);
// Third ATTENDEE property.
- AttendeeData.clear();
+ attendeeData.clear();
- if (TestEvent.AttendeeList.size() > 2){
+ if (testEvent.attendeeList.size() > 2){
- AttendeeData = TestEvent.AttendeeList[2];
+ attendeeData = testEvent.attendeeList[2];
}
- if (TestEvent.AttendeeList.size() > 2){
+ if (testEvent.attendeeList.size() > 2){
- AttendeeDataDirectoryEntry = TestEvent.AttendeeListDirectoryEntry[2];
+ attendeeDataDirectoryEntry = testEvent.attendeeListDirectoryEntry[2];
}
- if (TestEvent.AttendeeList.size() > 2){
+ if (testEvent.attendeeList.size() > 2){
- AttendeeDataSentBy = TestEvent.AttendeeListSentBy[2];
+ attendeeDataSentBy = testEvent.attendeeListSentBy[2];
}
- if (TestEvent.AttendeeList.size() > 2){
+ if (testEvent.attendeeList.size() > 2){
- AttendeeDataCommonName = TestEvent.AttendeeListCommonName[2];
+ attendeeDataCommonName = testEvent.attendeeListCommonName[2];
}
- if (TestEvent.AttendeeList.size() > 2){
+ if (testEvent.attendeeList.size() > 2){
- AttendeeDataCalendarUserType = TestEvent.AttendeeListCalendarUserType[2];
+ attendeeDataCalendarUserType = testEvent.attendeeListCalendarUserType[2];
}
- if (TestEvent.AttendeeList.size() > 2){
+ if (testEvent.attendeeList.size() > 2){
- AttendeeDataParticipationStatus = TestEvent.AttendeeListParticipationStatus[2];
+ attendeeDataParticipationStatus = testEvent.attendeeListParticipationStatus[2];
}
- if (TestEvent.AttendeeList.size() > 2){
+ if (testEvent.attendeeList.size() > 2){
- AttendeeDataLanguage = TestEvent.AttendeeListLanguage[2];
+ attendeeDataLanguage = testEvent.attendeeListLanguage[2];
}
- if (TestEvent.AttendeeList.size() > 2){
+ if (testEvent.attendeeList.size() > 2){
- AttendeeDataTokens = TestEvent.AttendeeListTokens[2];
+ attendeeDataTokens = testEvent.attendeeListTokens[2];
}
- ASSERT_EQ("Attendee Three", AttendeeData);
- ASSERT_EQ("null:nodata", AttendeeDataDirectoryEntry);
- ASSERT_EQ("mailto:sent.by@example.com", AttendeeDataSentBy);
- ASSERT_EQ("Attendee The Third", AttendeeDataCommonName);
- ASSERT_EQ("INDIVIDUAL", AttendeeDataCalendarUserType);
- ASSERT_EQ("ACCEPTED", AttendeeDataParticipationStatus);
- ASSERT_EQ("kw", AttendeeDataLanguage);
- ASSERT_EQ("EXAMPLE=DATA", AttendeeDataTokens);
+ ASSERT_EQ("Attendee Three", attendeeData);
+ ASSERT_EQ("null:nodata", attendeeDataDirectoryEntry);
+ ASSERT_EQ("mailto:sent.by@example.com", attendeeDataSentBy);
+ ASSERT_EQ("Attendee The Third", attendeeDataCommonName);
+ ASSERT_EQ("INDIVIDUAL", attendeeDataCalendarUserType);
+ ASSERT_EQ("ACCEPTED", attendeeDataParticipationStatus);
+ ASSERT_EQ("kw", attendeeDataLanguage);
+ ASSERT_EQ("EXAMPLE=DATA", attendeeDataTokens);
// Get the first CATEGORIES.
- std::string CategoryData;
+ std::string categoryData;
- if (TestEvent.CategoriesList.begin() != TestEvent.CategoriesList.end()){
+ if (testEvent.categoriesList.begin() != testEvent.categoriesList.end()){
- CategoryData = TestEvent.CategoriesList[0];
+ categoryData = testEvent.categoriesList[0];
}
- ASSERT_EQ("CATEGORY ONE, CATEGORY TWO", CategoryData);
+ ASSERT_EQ("CATEGORY ONE, CATEGORY TWO", categoryData);
- CategoryData.clear();
+ categoryData.clear();
- std::string CategoryLanguage;
+ std::string categoryLanguage;
// Get the second CATEGORIES.
- if (TestEvent.CategoriesList.size() > 1){
+ if (testEvent.categoriesList.size() > 1){
- CategoryData = TestEvent.CategoriesList[1];
+ categoryData = testEvent.categoriesList[1];
}
- if (TestEvent.CategoriesList.size() > 1){
+ if (testEvent.categoriesList.size() > 1){
- CategoryLanguage = TestEvent.CategoriesListLanguage[1];
+ categoryLanguage = testEvent.categoriesListLanguage[1];
}
- ASSERT_EQ("CATEGORY THREE, CATEGORY FOUR", CategoryData);
- ASSERT_EQ("en", CategoryLanguage);
+ ASSERT_EQ("CATEGORY THREE, CATEGORY FOUR", categoryData);
+ ASSERT_EQ("en", categoryLanguage);
- CategoryData.clear();
- CategoryLanguage.clear();
+ categoryData.clear();
+ categoryLanguage.clear();
// Get the third CATEGORIES.
- std::string CategoryTokens;
+ std::string categoryTokens;
- if (TestEvent.CategoriesList.size() > 2){
+ if (testEvent.CategoriesList.size() > 2){
- CategoryData = TestEvent.CategoriesList[2];
+ categoryData = testEvent.CategoriesList[2];
}
- if (TestEvent.CategoriesList.size() > 2){
+ if (testEvent.CategoriesList.size() > 2){
- CategoryLanguage = TestEvent.CategoriesListLanguage[2];
+ categoryLanguage = testEvent.CategoriesListLanguage[2];
}
- if (TestEvent.CategoriesList.size() > 2){
+ if (testEvent.CategoriesList.size() > 2){
- CategoryTokens = TestEvent.CategoriesListTokens[2];
+ categoryTokens = testEvent.CategoriesListTokens[2];
}
- ASSERT_EQ("CATEGORY FIVE, CATEGORY SIX, CATEGORY SEVEN", CategoryData);
- ASSERT_EQ("en-GB", CategoryLanguage);
- ASSERT_EQ("SAMPLE=TOKEN", CategoryTokens);
+ ASSERT_EQ("CATEGORY FIVE, CATEGORY SIX, CATEGORY SEVEN", categoryData);
+ ASSERT_EQ("en-GB", categoryLanguage);
+ ASSERT_EQ("SAMPLE=TOKEN", categoryTokens);
// Get the first COMMENT.
- std::string CommentData;
+ std::string commentData;
- if (TestEvent.CommentList.begin() != TestEvent.CommentList.end()){
+ if (testEvent.commentList.begin() != testEvent.commentList.end()){
- CommentData = TestEvent.CommentList[0];
+ commentData = testEvent.commentList[0];
}
- ASSERT_EQ("This is the first comment.", CommentData);
+ ASSERT_EQ("This is the first comment.", commentData);
// Get the second COMMENT.
- CommentData.clear();
+ commentData.clear();
- std::string CommentDataAltRep;
- std::string CommentDataLanguage;
+ std::string commentDataAltRep;
+ std::string commentDataLanguage;
- if (TestEvent.CommentList.size() > 1){
+ if (testEvent.commentList.size() > 1){
- CommentData = TestEvent.CommentList[1];
+ commentData = testEvent.commentList[1];
}
- if (TestEvent.CommentList.size() > 1){
+ if (testEvent.commentList.size() > 1){
- CommentDataAltRep = TestEvent.CommentListAltRep[1];
+ commentDataAltRep = testEvent.commentListAltRep[1];
}
- if (TestEvent.CommentList.size() > 1){
+ if (testEvent.commentList.size() > 1){
- CommentDataLanguage = TestEvent.CommentListLanguage[1];
+ commentDataLanguage = testEvent.commentListLanguage[1];
}
- ASSERT_EQ("This is the second comment.", CommentData);
- ASSERT_EQ("null:nodata", CommentDataAltRep);
- ASSERT_EQ("en", CommentDataLanguage);
+ ASSERT_EQ("This is the second comment.", commentData);
+ ASSERT_EQ("null:nodata", commentDataAltRep);
+ ASSERT_EQ("en", commentDataLanguage);
// Get the third COMMENT.
- CommentData.clear();
+ commentData.clear();
- std::string CommentDataTokens;
+ std::string commentDataTokens;
- if (TestEvent.CommentList.size() > 2){
+ if (testEvent.commentList.size() > 2){
- CommentData = TestEvent.CommentList[2];
+ commentData = testEvent.commentList[2];
}
- if (TestEvent.CommentList.size() > 2){
+ if (testEvent.commentList.size() > 2){
- CommentDataTokens = TestEvent.CommentListTokens[2];
+ commentDataTokens = testEvent.commentListTokens[2];
}
- ASSERT_EQ("This is the third comment.", CommentData);
- ASSERT_EQ("ZEBRAS=YES", CommentDataTokens);
+ ASSERT_EQ("This is the third comment.", commentData);
+ ASSERT_EQ("ZEBRAS=YES", commentDataTokens);
// Get the first CONTACT.
- std::string ContactData;
+ std::string contactData;
- if (TestEvent.ContactList.begin() != TestEvent.ContactList.end()){
+ if (testEvent.contactList.begin() != testEvent.contactList.end()){
- ContactData = TestEvent.ContactList[0];
+ contactData = testEvent.contactList[0];
}
- ASSERT_EQ("First Contact", ContactData);
+ ASSERT_EQ("First Contact", contactData);
// Get the second CONTACT.
- ContactData.clear();
+ contactData.clear();
- std::string ContactDataAltRep;
- std::string ContactDataLanguage;
+ std::string contactDataAltRep;
+ std::string contactDataLanguage;
- if (TestEvent.ContactList.size() > 1){
+ if (testEvent.contactList.size() > 1){
- ContactData = TestEvent.ContactList[1];
+ contactData = testEvent.contactList[1];
}
- if (TestEvent.ContactList.size() > 1){
+ if (testEvent.contactList.size() > 1){
- ContactDataAltRep = TestEvent.ContactListAltRep[1];
+ contactDataAltRep = testEvent.contactListAltRep[1];
}
- if (TestEvent.ContactList.size() > 1){
+ if (testEvent.contactList.size() > 1){
- ContactDataLanguage = TestEvent.ContactListLanguage[1];
+ contactDataLanguage = testEvent.contactListLanguage[1];
}
- ASSERT_EQ("Second Contact", ContactData);
- ASSERT_EQ("null:nodata", ContactDataAltRep);
- ASSERT_EQ("en-GB", ContactDataLanguage);
+ ASSERT_EQ("Second Contact", contactData);
+ ASSERT_EQ("null:nodata", contactDataAltRep);
+ ASSERT_EQ("en-GB", contactDataLanguage);
// Get the third CONTACT.
- ContactData.clear();
+ contactData.clear();
- std::string ContactDataTokens;
+ std::string contactDataTokens;
- if (TestEvent.ContactList.size() > 2){
+ if (testEvent.contactList.size() > 2){
- ContactData = TestEvent.ContactList[2];
+ contactData = testEvent.contactList[2];
}
- if (TestEvent.ContactList.size() > 2){
+ if (testEvent.contactList.size() > 2){
- ContactDataTokens = TestEvent.ContactListTokens[2];
+ contactDataTokens = testEvent.contactListTokens[2];
}
- ASSERT_EQ("Third Contact", ContactData);
- ASSERT_EQ("ZEBRAS=NO", ContactDataTokens);
+ ASSERT_EQ("Third Contact", contactData);
+ ASSERT_EQ("ZEBRAS=NO", contactDataTokens);
// Get the first EXDATE.
- std::string ExcludeDate;
+ std::string excludeDate;
- if (TestEvent.ExcludeDateData.begin() != TestEvent.ExcludeDateData.end()){
+ if (testEvent.excludeDateData.begin() != testEvent.excludeDateData.end()){
- ExcludeDate = TestEvent.ExcludeDateData[0];
+ excludeDate = testEvent.excludeDateData[0];
}
- ASSERT_EQ("20160125T120000Z", ExcludeDate);
+ ASSERT_EQ("20160125T120000Z", excludeDate);
// Get the second EXDATE.
- ExcludeDate.clear();
+ excludeDate.clear();
- std::string ExcludeDataTimeZoneParam;
- std::string ExcludeDataValue;
+ std::string excludeDataTimeZoneParam;
+ std::string excludeDataValue;
- if (TestEvent.ContactList.size() > 1){
+ if (testEvent.contactList.size() > 1){
- ExcludeDate = TestEvent.ExcludeDateData[1];
+ excludeDate = testEvent.excludeDateData[1];
}
- if (TestEvent.ContactList.size() > 1){
+ if (testEvent.contactList.size() > 1){
- ExcludeDataTimeZoneParam = TestEvent.ExcludeDateDataTimeZoneParam[1];
+ excludeDataTimeZoneParam = testEvent.excludeDateDataTimeZoneParam[1];
}
- if (TestEvent.ContactList.size() > 1){
+ if (testEvent.contactList.size() > 1){
- ExcludeDataValue = TestEvent.ExcludeDateDataValue[1];
+ excludeDataValue = testEvent.excludeDateDataValue[1];
}
- ASSERT_EQ("20160125T130000Z", ExcludeDate);
- ASSERT_EQ("DATE-TIME", ExcludeDataValue);
- ASSERT_EQ("Europe/Truro", ExcludeDataTimeZoneParam);
+ ASSERT_EQ("20160125T130000Z", excludeDate);
+ ASSERT_EQ("DATE-TIME", excludeDataValue);
+ ASSERT_EQ("Europe/Truro", excludeDataTimeZoneParam);
// Get the third EXDATE.
- ExcludeDate.clear();
+ excludeDate.clear();
- std::string ExcludeDataTokens;
+ std::string excludeDataTokens;
- if (TestEvent.ContactList.size() > 2){
+ if (testEvent.contactList.size() > 2){
- ExcludeDate = TestEvent.ExcludeDateData[2];
+ excludeDate = testEvent.excludeDateData[2];
}
- if (TestEvent.ContactList.size() > 2){
+ if (testEvent.contactList.size() > 2){
- ExcludeDataTokens = TestEvent.ExcludeDateDataTokens[2];
+ excludeDataTokens = testEvent.excludeDateDataTokens[2];
}
- ASSERT_EQ("20160125T133000Z", ExcludeDate);
- ASSERT_EQ("ZOOP=ZIPPO", ExcludeDataTokens);
+ ASSERT_EQ("20160125T133000Z", excludeDate);
+ ASSERT_EQ("ZOOP=ZIPPO", excludeDataTokens);
// Get the first REQUEST-STATUS.
- std::string RequestStatus;
+ std::string requestStatus;
- if (TestEvent.RequestStatusData.begin() != TestEvent.RequestStatusData.end()){
+ if (testEvent.requestStatusData.begin() != testEvent.requestStatusData.end()){
- RequestStatus = TestEvent.RequestStatusData[0];
+ requestStatus = testEvent.requestStatusData[0];
}
- ASSERT_EQ("2.0;Success", RequestStatus);
+ ASSERT_EQ("2.0;Success", requestStatus);
// Get the second REQUEST-STATUS.
- RequestStatus.clear();
+ requestStatus.clear();
- std::string RequestLanguage;
+ std::string requestLanguage;
- if (TestEvent.RequestStatusData.size() > 1){
+ if (testEvent.requestStatusData.size() > 1){
- RequestStatus = TestEvent.RequestStatusData[1];
+ requestStatus = testEvent.requestStatusData[1];
}
- if (TestEvent.RequestStatusData.size() > 1){
+ if (testEvent.requestStatusData.size() > 1){
- RequestLanguage = TestEvent.RequestStatusLanguage[1];
+ requestLanguage = testEvent.requestStatusLanguage[1];
}
- ASSERT_EQ("3.42;Really big irrecoverable error caused by the user", RequestStatus);
- ASSERT_EQ("en", RequestLanguage);
+ ASSERT_EQ("3.42;Really big irrecoverable error caused by the user", requestStatus);
+ ASSERT_EQ("en", requestLanguage);
// Get the third REQUEST-STATUS.
- RequestStatus.clear();
+ requestStatus.clear();
- std::string RequestTokens;
+ std::string requestTokens;
- if (TestEvent.RequestStatusData.size() > 2){
+ if (testEvent.requestStatusData.size() > 2){
- RequestStatus = TestEvent.RequestStatusData[2];
+ requestStatus = testEvent.requestStatusData[2];
}
- if (TestEvent.RequestStatusData.size() > 2){
+ if (testEvent.requestStatusData.size() > 2){
- RequestTokens = TestEvent.RequestStatusTokens[2];
+ requestTokens = testEvent.requestStatusTokens[2];
}
- ASSERT_EQ("3.7;Invalid calendar user", RequestStatus);
- ASSERT_EQ("USER=MISSING", RequestTokens);
+ ASSERT_EQ("3.7;Invalid calendar user", requestStatus);
+ ASSERT_EQ("USER=MISSING", requestTokens);
// Get the first RELATED-TO.
- std::string RelatedTo;
+ std::string relatedTo;
- if (TestEvent.RelatedToData.begin() != TestEvent.RelatedToData.end()){
+ if (testEvent.relatedToData.begin() != testEvent.relatedToData.end()){
- RelatedTo = TestEvent.RelatedToData[0];
+ relatedTo = testEvent.relatedToData[0];
}
- ASSERT_EQ("person.1@example.com", RelatedTo);
+ ASSERT_EQ("person.1@example.com", relatedTo);
// Get the second RELATED-TO.
- RelatedTo.clear();
+ relatedTo.clear();
- std::string RelatedToType;
+ std::string relatedToType;
- if (TestEvent.RelatedToData.size() > 1){
+ if (testEvent.relatedToData.size() > 1){
- RelatedTo = TestEvent.RelatedToData[1];
+ relatedTo = testEvent.relatedToData[1];
}
- if (TestEvent.RelatedToData.size() > 1){
+ if (testEvent.relatedToData.size() > 1){
- RelatedToType = TestEvent.RelatedToDataRelationType[1];
+ relatedToType = testEvent.relatedToDataRelationType[1];
}
- ASSERT_EQ("person.2@example.com", RelatedTo);
- ASSERT_EQ("PARENT", RelatedToType);
+ ASSERT_EQ("person.2@example.com", relatedTo);
+ ASSERT_EQ("PARENT", relatedToType);
// Get the third RELATED-TO.
- RelatedTo.clear();
+ relatedTo.clear();
- std::string RelatedToTokens;
+ std::string relatedToTokens;
- if (TestEvent.RelatedToData.size() > 2){
+ if (testEvent.relatedToData.size() > 2){
- RelatedTo = TestEvent.RelatedToData[2];
+ relatedTo = testEvent.relatedToData[2];
}
- if (TestEvent.RelatedToData.size() > 2){
+ if (testEvent.relatedToData.size() > 2){
- RelatedToTokens = TestEvent.RelatedToDataTokens[2];
+ relatedToTokens = testEvent.relatedToDataTokens[2];
}
- ASSERT_EQ("person.3@example.com", RelatedTo);
- ASSERT_EQ("SCHOOL=MEETING", RelatedToTokens);
+ ASSERT_EQ("person.3@example.com", relatedTo);
+ ASSERT_EQ("SCHOOL=MEETING", relatedToTokens);
// Get the first RESOURCES.
- std::string Resources;
+ std::string resources;
- if (TestEvent.ResourcesData.begin() != TestEvent.ResourcesData.end()){
+ if (testEvent.resourcesData.begin() != testEvent.resourcesData.end()){
- Resources = TestEvent.ResourcesData[0];
+ resources = testEvent.resourcesData[0];
}
- ASSERT_EQ("DMAC RECEIVER", Resources);
+ ASSERT_EQ("DMAC RECEIVER", resources);
// Get the second RESOURCES.
- Resources.clear();
+ resources.clear();
- std::string ResourcesLanguage;
+ std::string resourcesLanguage;
- if (TestEvent.ResourcesData.size() > 1){
+ if (testEvent.resourcesData.size() > 1){
- Resources = TestEvent.ResourcesData[1];
+ resources = testEvent.resourcesData[1];
}
- if (TestEvent.ResourcesData.size() > 1){
+ if (testEvent.resourcesData.size() > 1){
- ResourcesLanguage = TestEvent.ResourcesDataLanguage[1];
+ resourcesLanguage = testEvent.resourcesDataLanguage[1];
}
- ASSERT_EQ("PAL-I TELEVISION SET", Resources);
- ASSERT_EQ("en", ResourcesLanguage);
+ ASSERT_EQ("PAL-I TELEVISION SET", resources);
+ ASSERT_EQ("en", resourcesLanguage);
// Get the third RESOURCES.
- Resources.clear();
+ resources.clear();
- std::string ResourcesAltRep;
- std::string ResourcesTokens;
+ std::string resourcesAltRep;
+ std::string resourcesTokens;
- if (TestEvent.ResourcesData.size() > 2){
+ if (testEvent.resourcesData.size() > 2){
- Resources = TestEvent.ResourcesData[2];
+ resources = testEvent.resourcesData[2];
}
- if (TestEvent.ResourcesData.size() > 2){
+ if (testEvent.resourcesData.size() > 2){
- ResourcesAltRep = TestEvent.ResourcesDataAltRep[2];
+ resourcesAltRep = testEvent.resourcesDataAltRep[2];
}
- if (TestEvent.ResourcesData.size() > 2){
+ if (testEvent.resourcesData.size() > 2){
- ResourcesTokens = TestEvent.ResourcesDataTokens[2];
+ resourcesTokens = testEvent.resourcesDataTokens[2];
}
- ASSERT_EQ("PAL/SECAM VCR", Resources);
- ASSERT_EQ("null:nodata", ResourcesAltRep);
- ASSERT_EQ("STATUS=BROKEN", ResourcesTokens);
+ ASSERT_EQ("PAL/SECAM VCR", resources);
+ ASSERT_EQ("null:nodata", resourcesAltRep);
+ ASSERT_EQ("STATUS=BROKEN", resourcesTokens);
// Get the first RDATE.
- std::string RecurrenceDate;
+ std::string recurrenceDate;
- if (TestEvent.RecurranceDateData.begin() != TestEvent.RecurranceDateData.end()){
+ if (testEvent.recurranceDateData.begin() != testEvent.recurranceDateData.end()){
- RecurrenceDate = TestEvent.RecurranceDateData[0];
+ recurrenceDate = testEvent.recurranceDateData[0];
}
- ASSERT_EQ("20160120", RecurrenceDate);
+ ASSERT_EQ("20160120", recurrenceDate);
// Get the second RDATE.
- RecurrenceDate.clear();
+ recurrenceDate.clear();
- std::string RecurrenceDateTimeZoneParam;
- std::string RecurrenceDateValue;
+ std::string recurrenceDateTimeZoneParam;
+ std::string recurrenceDateValue;
- if (TestEvent.RecurranceDateData.size() > 1){
+ if (testEvent.recurranceDateData.size() > 1){
- RecurrenceDate = TestEvent.RecurranceDateData[1];
+ recurrenceDate = testEvent.recurranceDateData[1];
}
- if (TestEvent.RecurranceDateData.size() > 1){
+ if (testEvent.recurranceDateData.size() > 1){
- RecurrenceDateTimeZoneParam = TestEvent.RecurranceDateDataTimeZoneParam[1];
+ recurrenceDateTimeZoneParam = testEvent.recurranceDateDataTimeZoneParam[1];
}
- if (TestEvent.RecurranceDateData.size() > 1){
+ if (testEvent.recurranceDateData.size() > 1){
- RecurrenceDateValue = TestEvent.RecurranceDateDataValue[1];
+ recurrenceDateValue = testEvent.recurranceDateDataValue[1];
}
- ASSERT_EQ("20160121", RecurrenceDate);
- ASSERT_EQ("DATE", RecurrenceDateValue);
- ASSERT_EQ("Europe/Truro", RecurrenceDateTimeZoneParam);
+ ASSERT_EQ("20160121", recurrenceDate);
+ ASSERT_EQ("DATE", recurrenceDateValue);
+ ASSERT_EQ("Europe/Truro", recurrenceDateTimeZoneParam);
// Get the third RDATE.
- RecurrenceDate.clear();
+ recurrenceDate.clear();
- std::string RecurrenceTokens;
+ std::string recurrenceTokens;
- if (TestEvent.RecurranceDateData.size() > 2){
+ if (testEvent.recurranceDateData.size() > 2){
- RecurrenceDate = TestEvent.RecurranceDateData[2];
+ recurrenceDate = testEvent.recurranceDateData[2];
}
- if (TestEvent.RecurranceDateData.size() > 2){
+ if (testEvent.recurranceDateData.size() > 2){
- RecurrenceTokens = TestEvent.RecurranceDateDataTokens[2];
+ recurrenceTokens = testEvent.recurranceDateDataTokens[2];
}
- ASSERT_EQ("20160520", RecurrenceDate);
- ASSERT_EQ("ZILCH=DATA", RecurrenceTokens);
+ ASSERT_EQ("20160520", recurrenceDate);
+ ASSERT_EQ("ZILCH=DATA", recurrenceTokens);
// Get the first X-EXAMPLE1 token.
- std::string XTokenName;
- std::string XTokenData;
+ std::string xTokenName;
+ std::string xTokenData;
- if (TestEvent.XTokensData.size() != 0 ){
+ if (testEvent.xTokensData.size() != 0 ){
- XTokenData = TestEvent.XTokensData[0];
+ xTokenData = testEvent.xTokensData[0];
}
- if (TestEvent.XTokensData.size() != 0){
+ if (testEvent.xTokensData.size() != 0){
- XTokenName = TestEvent.XTokensDataTokens[0];
+ xTokenName = testEvent.xTokensDataTokens[0];
}
- ASSERT_EQ("Moo", XTokenData);
- ASSERT_EQ("X-EXAMPLE1", XTokenName);
+ ASSERT_EQ("Moo", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1", xTokenName);
// Get the second X-EXAMPLE1 token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestEvent.XTokensData.size() > 1){
+ if (testEvent.xTokensData.size() > 1){
- XTokenData = TestEvent.XTokensData[1];
+ xTokenData = testEvent.xTokensData[1];
}
- if (TestEvent.XTokensData.size() > 1){
+ if (testEvent.xTokensData.size() > 1){
- XTokenName = TestEvent.XTokensDataTokens[1];
+ xTokenName = testEvent.xTokensDataTokens[1];
}
- ASSERT_EQ("Meep", XTokenData);
- ASSERT_EQ("X-EXAMPLE1;ANIMAL=NOPE", XTokenName);
+ ASSERT_EQ("Meep", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1;ANIMAL=NOPE", xTokenName);
// Get the third X-EXAMPLE1 token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestEvent.XTokensData.size() > 2){
+ if (testEvent.xTokensData.size() > 2){
- XTokenData = TestEvent.XTokensData[2];
+ xTokenData = testEvent.xTokensData[2];
}
- if (TestEvent.XTokensData.size() > 2){
+ if (testEvent.xTokensData.size() > 2){
- XTokenName = TestEvent.XTokensDataTokens[2];
+ xTokenName = testEvent.xTokensDataTokens[2];
}
- ASSERT_EQ("Meow", XTokenData);
- ASSERT_EQ("X-EXAMPLE1;ANIMAL=CAT", XTokenName);
+ ASSERT_EQ("Meow", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1;ANIMAL=CAT", xTokenName);
// Get the first X-EXAMPLE2 token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestEvent.XTokensData.size() > 3){
+ if (testEvent.xTokensData.size() > 3){
- XTokenData = TestEvent.XTokensData[3];
+ xTokenData = testEvent.xTokensData[3];
}
- if (TestEvent.XTokensData.size() > 3){
+ if (testEvent.xTokensData.size() > 3){
- XTokenName = TestEvent.XTokensDataTokens[3];
+ xTokenName = testEvent.xTokensDataTokens[3];
}
- ASSERT_EQ("Dish", XTokenData);
- ASSERT_EQ("X-EXAMPLE2", XTokenName);
+ ASSERT_EQ("Dish", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2", xTokenName);
// Get the second X-EXAMPLE2 token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestEvent.XTokensData.size() > 4){
+ if (testEvent.xTokensData.size() > 4){
- XTokenData = TestEvent.XTokensData[4];
+ xTokenData = testEvent.xTokensData[4];
}
- if (TestEvent.XTokensData.size() > 4){
+ if (testEvent.xTokensData.size() > 4){
- XTokenName = TestEvent.XTokensDataTokens[4];
+ xTokenName = testEvent.xTokensDataTokens[4];
}
- ASSERT_EQ("Fork", XTokenData);
- ASSERT_EQ("X-EXAMPLE2;OBJECT=KITCHEN", XTokenName);
+ ASSERT_EQ("Fork", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2;OBJECT=KITCHEN", xTokenName);
// Get the third X-EXAMPLE2 token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestEvent.XTokensData.size() > 5){
+ if (testEvent.xTokensData.size() > 5){
- XTokenData = TestEvent.XTokensData[5];
+ xTokenData = testEvent.xTokensData[5];
}
- if (TestEvent.XTokensData.size() > 5){
+ if (testEvent.xTokensData.size() > 5){
- XTokenName = TestEvent.XTokensDataTokens[5];
+ xTokenName = testEvent.xTokensDataTokens[5];
}
- ASSERT_EQ("Table", XTokenData);
- ASSERT_EQ("X-EXAMPLE2;OBJECT=LIVINGROOM", XTokenName);
+ ASSERT_EQ("Table", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2;OBJECT=LIVINGROOM", xTokenName);
// Get the X-STATUS token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestEvent.XTokensData.size() > 6){
+ if (testEvent.xTokensData.size() > 6){
- XTokenData = TestEvent.XTokensData[6];
+ xTokenData = testEvent.xTokensData[6];
}
- if (TestEvent.XTokensData.size() > 6){
+ if (testEvent.xTokensData.size() > 6){
- XTokenName = TestEvent.XTokensDataTokens[6];
+ xTokenName = testEvent.xTokensDataTokens[6];
}
- ASSERT_EQ("Idle", XTokenData);
- ASSERT_EQ("X-STATUS;HOLIDAY=YES", XTokenName);
+ ASSERT_EQ("Idle", xTokenData);
+ ASSERT_EQ("X-STATUS;HOLIDAY=YES", xTokenName);
// Get the X-TRANSPORT token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestEvent.XTokensData.size() > 7){
+ if (testEvent.xTokensData.size() > 7){
- XTokenData = TestEvent.XTokensData[7];
+ xTokenData = testEvent.xTokensData[7];
}
- if (TestEvent.XTokensData.size() > 7){
+ if (testEvent.xTokensData.size() > 7){
- XTokenName = TestEvent.XTokensDataTokens[7];
+ xTokenName = testEvent.xTokensDataTokens[7];
}
- ASSERT_EQ("Private Hire", XTokenData);
- ASSERT_EQ("X-TRANSPORT;PUBLIC=NO", XTokenName);
+ ASSERT_EQ("Private Hire", xTokenData);
+ ASSERT_EQ("X-TRANSPORT;PUBLIC=NO", xTokenName);
// Get the X-PHANTOM-STATUS token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestEvent.XTokensData.size() > 8){
+ if (testEvent.xTokensData.size() > 8){
- XTokenData = TestEvent.XTokensData[8];
+ xTokenData = testEvent.xTokensData[8];
}
- if (TestEvent.XTokensData.size() > 8){
+ if (testEvent.xTokensData.size() > 8){
- XTokenName = TestEvent.XTokensDataTokens[8];
+ xTokenName = testEvent.xTokensDataTokens[8];
}
- ASSERT_EQ("None", XTokenData);
- ASSERT_EQ("X-PHANTOM-STATUS;HELP=NONE", XTokenName);
+ ASSERT_EQ("None", xTokenData);
+ ASSERT_EQ("X-PHANTOM-STATUS;HELP=NONE", xTokenName);
}
TEST(iCalendarEvent, AlarmTests){
- CalendarEventObject TestEvent;
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestEvent.LoadFile("iCalendarEvent-Load2.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestEvent.ValidBaseObject());
+ CalendarEventObject testEvent;
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testEvent.LoadFile("iCalendarEvent-Load2.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testEvent.ValidBaseObject());
// Tests for the first VALARM property.
- std::string ActionData;
- std::string ActionDataTokens;
+ std::string actionData;
+ std::string actionDataTokens;
- std::string TriggerData;
- std::string TriggerRelated;
- std::string TriggerValue;
- std::string TriggerTokens;
+ std::string triggerData;
+ std::string triggerRelated;
+ std::string triggerValue;
+ std::string triggerTokens;
- std::string DurationData;
- std::string DurationTokens;
+ std::string durationData;
+ std::string durationTokens;
- std::string RepeatData;
- std::string RepeatTokens;
+ std::string repeatData;
+ std::string repeatTokens;
- std::string XTokenData;
- std::string XTokenName;
+ std::string xTokenData;
+ std::string xTokenName;
- if (TestEvent.CalendarAlarmData.size() > 0){
+ if (testEvent.calendarAlarmData.size() > 0){
- ActionData = TestEvent.CalendarAlarmData[0].AlarmAction;
- ActionDataTokens = TestEvent.CalendarAlarmData[0].AlarmActionTokens;
+ ActionData = testEvent.calendarAlarmData[0].alarmAction;
+ ActionDataTokens = testEvent.calendarAlarmData[0].alarmActionTokens;
- TriggerData = TestEvent.CalendarAlarmData[0].TriggerData;
- TriggerRelated = TestEvent.CalendarAlarmData[0].TriggerRelated;
- TriggerValue = TestEvent.CalendarAlarmData[0].TriggerValue;
- TriggerTokens = TestEvent.CalendarAlarmData[0].TriggerTokens;
+ TriggerData = testEvent.calendarAlarmData[0].triggerData;
+ TriggerRelated = testEvent.calendarAlarmData[0].triggerRelated;
+ TriggerValue = testEvent.calendarAlarmData[0].triggerValue;
+ TriggerTokens = testEvent.calendarAlarmData[0].triggerTokens;
- DurationData = TestEvent.CalendarAlarmData[0].DurationData;
- DurationTokens = TestEvent.CalendarAlarmData[0].DurationTokens;
+ DurationData = testEvent.calendarAlarmData[0].durationData;
+ DurationTokens = testEvent.calendarAlarmData[0].durationTokens;
- RepeatData = TestEvent.CalendarAlarmData[0].RepeatData;
- RepeatTokens = TestEvent.CalendarAlarmData[0].RepeatTokens;
+ RepeatData = testEvent.calendarAlarmData[0].repeatData;
+ RepeatTokens = testEvent.calendarAlarmData[0].repeatTokens;
}
- ASSERT_EQ("AUDIO", ActionData);
- ASSERT_EQ("FUNKY=SOUNDS", ActionDataTokens);
+ ASSERT_EQ("AUDIO", actionData);
+ ASSERT_EQ("FUNKY=SOUNDS", actionDataTokens);
- ASSERT_EQ("20160220T160000Z", TriggerData);
- ASSERT_EQ("END", TriggerRelated);
- ASSERT_EQ("DATE-TIME", TriggerValue);
- ASSERT_EQ("PUSH=BUTTON", TriggerTokens);
+ ASSERT_EQ("20160220T160000Z", triggerData);
+ ASSERT_EQ("END", triggerRelated);
+ ASSERT_EQ("DATE-TIME", triggerValue);
+ ASSERT_EQ("PUSH=BUTTON", triggerTokens);
- ASSERT_EQ("PT5H", DurationData);
- ASSERT_EQ("FLYING=NO", DurationTokens);
+ ASSERT_EQ("PT5H", durationData);
+ ASSERT_EQ("FLYING=NO", durationTokens);
- ASSERT_EQ("PT5M", RepeatData);
- ASSERT_EQ("NEVER=SLEEP", RepeatTokens);
+ ASSERT_EQ("PT5M", repeatData);
+ ASSERT_EQ("NEVER=SLEEP", repeatTokens);
// Tests for ATTACH. First ATTACH property.
- std::string AttachData;
- std::string AttachDataFormatType;
- std::string AttachDataValue;
- std::string AttachDataEncoding;
- std::string AttachDataTokens;
+ std::string attachData;
+ std::string attachDataFormatType;
+ std::string attachDataValue;
+ std::string attachDataEncoding;
+ std::string attachDataTokens;
- if (TestEvent.CalendarAlarmData[0].AttachList.begin() != TestEvent.CalendarAlarmData[0].AttachList.end()){
+ if (testEvent.calendarAlarmData[0].attachList.begin() != testEvent.calendarAlarmData[0].attachList.end()){
- AttachData = TestEvent.AttachList[0];
+ AttachData = testEvent.attachList[0];
}
- if (TestEvent.CalendarAlarmData[0].AttachListFormatType.begin() != TestEvent.CalendarAlarmData[0].AttachListFormatType.end()){
+ if (testEvent.calendarAlarmData[0].attachListFormatType.begin() != testEvent.calendaralarmData[0].attachListFormatType.end()){
- AttachDataFormatType = TestEvent.AttachListFormatType[0];
+ attachDataFormatType = testEvent.attachListFormatType[0];
}
- ASSERT_EQ("http://www.example.com/", AttachData);
- ASSERT_EQ("application/internet-shortcut", AttachDataFormatType);
+ ASSERT_EQ("http://www.example.com/", attachData);
+ ASSERT_EQ("application/internet-shortcut", attachDataFormatType);
// Second ATTACH property.
- AttachData.clear();
- AttachDataFormatType.clear();
- AttachDataValue.clear();
- AttachDataEncoding.clear();
+ attachData.clear();
+ attachDataFormatType.clear();
+ attachDataValue.clear();
+ attachDataEncoding.clear();
- if (TestEvent.CalendarAlarmData[0].AttachList.size() > 1){
+ if (testEvent.calendarAlarmData[0].attachList.size() > 1){
- AttachData = TestEvent.CalendarAlarmData[0].AttachList[1];
+ attachData = testEvent.calendarAlarmData[0].attachList[1];
}
- if (TestEvent.CalendarAlarmData[0].AttachListFormatType.size() > 1){
+ if (testEvent.calendarAlarmData[0].attachListFormatType.size() > 1){
- AttachDataFormatType = TestEvent.CalendarAlarmData[0].AttachListFormatType[1];
+ attachDataFormatType = testEvent.calendarAlarmData[0].attachListFormatType[1];
}
- ASSERT_EQ("http://www.example.com/page2.html", AttachData);
- ASSERT_EQ("application/internet-shortcut", AttachDataFormatType);
+ ASSERT_EQ("http://www.example.com/page2.html", attachData);
+ ASSERT_EQ("application/internet-shortcut", attachDataFormatType);
// Third ATTACH property.
- AttachData.clear();
- AttachDataFormatType.clear();
- AttachDataValue.clear();
- AttachDataEncoding.clear();
- AttachDataTokens.clear();
+ attachData.clear();
+ attachDataFormatType.clear();
+ attachDataValue.clear();
+ attachDataEncoding.clear();
+ attachDataTokens.clear();
- if (TestEvent.CalendarAlarmData[0].AttachList.size() > 2){
+ if (testEvent.calendarAlarmData[0].attachList.size() > 2){
- AttachData = TestEvent.CalendarAlarmData[0].AttachList[2];
+ attachData = testEvent.calendarAlarmData[0].attachList[2];
}
- if (TestEvent.CalendarAlarmData[0].AttachListFormatType.size() > 2){
+ if (testEvent.calendarAlarmData[0].attachListFormatType.size() > 2){
- AttachDataFormatType = TestEvent.CalendarAlarmData[0].AttachListFormatType[2];
+ attachDataFormatType = testEvent.calendarAlarmData[0].attachListFormatType[2];
}
- if (TestEvent.CalendarAlarmData[0].AttachListValue.size() > 2){
+ if (testEvent.calendarAlarmData[0].attachListValue.size() > 2){
- AttachDataValue = TestEvent.CalendarAlarmData[0].AttachListValue[2];
+ attachDataValue = testEvent.calendarAlarmData[0].attachListValue[2];
}
- if (TestEvent.CalendarAlarmData[0].AttachListFormatType.size() > 2){
+ if (testEvent.calendarAlarmData[0].attachListFormatType.size() > 2){
- AttachDataEncoding = TestEvent.CalendarAlarmData[0].AttachListEncoding[2];
+ attachDataEncoding = testEvent.calendarAlarmData[0].attachListEncoding[2];
}
- if (TestEvent.CalendarAlarmData[0].AttachListTokens.size() > 2){
+ if (testEvent.calendarAlarmData[0].attachListTokens.size() > 2){
- AttachDataTokens = TestEvent.CalendarAlarmData[0].AttachListTokens[2];
+ attachDataTokens = testEvent.calendarAlarmData[0].attachListTokens[2];
}
- ASSERT_EQ("VGhpcyBpcyBhbiBleGFtcGxlIGZpbGU=", AttachData);
- ASSERT_EQ("text/plain", AttachDataFormatType);
- ASSERT_EQ("BASE64", AttachDataEncoding);
- ASSERT_EQ("BINARY", AttachDataValue);
- ASSERT_EQ("STUPID=EXAMPLE", AttachDataTokens);
+ ASSERT_EQ("VGhpcyBpcyBhbiBleGFtcGxlIGZpbGU=", attachData);
+ ASSERT_EQ("text/plain", attachDataFormatType);
+ ASSERT_EQ("BASE64", attachDataEncoding);
+ ASSERT_EQ("BINARY", attachDataValue);
+ ASSERT_EQ("STUPID=EXAMPLE", attachDataTokens);
// Test the first X-Token.
- if (TestEvent.CalendarAlarmData[0].XTokensData.size() > 0){
+ if (testEvent.calendarAlarmData[0].xTokensData.size() > 0){
- XTokenData = TestEvent.CalendarAlarmData[0].XTokensData[0];
- XTokenName = TestEvent.CalendarAlarmData[0].XTokensDataTokens[0];
+ xTokenData = testEvent.calendarAlarmData[0].xTokensData[0];
+ xTokenName = testEvent.calendarAlarmData[0].xTokensDataTokens[0];
}
- ASSERT_EQ("Example Data 1", XTokenData);
- ASSERT_EQ("X-EXAMPLE1;YAY=YES", XTokenName);
+ ASSERT_EQ("Example Data 1", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1;YAY=YES", xTokenName);
// Test the second X-Token.
- XTokenData.clear();
- XTokenName.clear();
+ xTokenData.clear();
+ xTokenName.clear();
- if (TestEvent.CalendarAlarmData[0].XTokensData.size() > 1){
+ if (testEvent.calendarAlarmData[0].xTokensData.size() > 1){
- XTokenData = TestEvent.CalendarAlarmData[0].XTokensData[1];
- XTokenName = TestEvent.CalendarAlarmData[0].XTokensDataTokens[1];
+ xTokenData = testEvent.calendarAlarmData[0].xTokensData[1];
+ xTokenName = testEvent.calendarAlarmData[0].xTokensDataTokens[1];
}
- ASSERT_EQ("Example Data 2", XTokenData);
- ASSERT_EQ("X-EXAMPLE2;NOPE=YEP", XTokenName);
+ ASSERT_EQ("Example Data 2", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2;NOPE=YEP", xTokenName);
// Test the third X-Token.
- XTokenData.clear();
- XTokenName.clear();
+ xTokenData.clear();
+ xTokenName.clear();
- if (TestEvent.CalendarAlarmData[0].XTokensData.size() > 2){
+ if (testEvent.calendarAlarmData[0].xTokensData.size() > 2){
- XTokenData = TestEvent.CalendarAlarmData[0].XTokensData[2];
- XTokenName = TestEvent.CalendarAlarmData[0].XTokensDataTokens[2];
+ xTokenData = testEvent.calendarAlarmData[0].xTokensData[2];
+ xTokenName = testEvent.calendarAlarmData[0].xTokensDataTokens[2];
}
- ASSERT_EQ("Example Data 3", XTokenData);
- ASSERT_EQ("X-EXAMPLE3;WORLD=NO", XTokenName);
+ ASSERT_EQ("Example Data 3", xTokenData);
+ ASSERT_EQ("X-EXAMPLE3;WORLD=NO", xTokenName);
// Tests for the second VALARM property.
- ActionData.clear();
- ActionDataTokens.clear();
+ actionData.clear();
+ actionDataTokens.clear();
- TriggerData.clear();
- TriggerRelated.clear();
- TriggerValue.clear();
- TriggerTokens.clear();
+ triggerData.clear();
+ triggerRelated.clear();
+ triggerValue.clear();
+ triggerTokens.clear();
- DurationData.clear();
- DurationTokens.clear();
+ durationData.clear();
+ durationTokens.clear();
- RepeatData.clear();
- RepeatTokens.clear();
+ repeatData.clear();
+ repeatTokens.clear();
- XTokenData.clear();
- XTokenName.clear();
+ xTokenData.clear();
+ xTokenName.clear();
- string DescriptionData;
- string DescriptionAltRep;
- string DescriptionLanguage;
- string DescriptionTokens;
+ string descriptionData;
+ string descriptionAltRep;
+ string descriptionLanguage;
+ string descriptionTokens;
- if (TestEvent.CalendarAlarmData.size() > 1){
+ if (testEvent.calendarAlarmData.size() > 1){
- ActionData = TestEvent.CalendarAlarmData[1].AlarmAction;
- ActionDataTokens = TestEvent.CalendarAlarmData[1].AlarmActionTokens;
+ actionData = testEvent.calendarAlarmData[1].alarmAction;
+ actionDataTokens = testEvent.calendarAlarmData[1].alarmActionTokens;
- TriggerData = TestEvent.CalendarAlarmData[1].TriggerData;
- TriggerRelated = TestEvent.CalendarAlarmData[1].TriggerRelated;
- TriggerValue = TestEvent.CalendarAlarmData[1].TriggerValue;
- TriggerTokens = TestEvent.CalendarAlarmData[1].TriggerTokens;
+ triggerData = testEvent.calendarAlarmData[1].triggerData;
+ triggerRelated = testEvent.calendarAlarmData[1].triggerRelated;
+ triggerValue = testEvent.calendarAlarmData[1].triggerValue;
+ triggerTokens = testEvent.calendarAlarmData[1].triggerTokens;
- DurationData = TestEvent.CalendarAlarmData[1].DurationData;
- DurationTokens = TestEvent.CalendarAlarmData[1].DurationTokens;
+ durationData = testEvent.calendarAlarmData[1].durationData;
+ durationTokens = testEvent.calendarAlarmData[1].durationTokens;
- RepeatData = TestEvent.CalendarAlarmData[1].RepeatData;
- RepeatTokens = TestEvent.CalendarAlarmData[1].RepeatTokens;
+ repeatData = testEvent.calendarAlarmData[1].repeatData;
+ repeatTokens = testEvent.calendarAlarmData[1].repeatTokens;
- DescriptionData = TestEvent.CalendarAlarmData[1].DescriptionData;
- DescriptionAltRep = TestEvent.CalendarAlarmData[1].DescriptionAltRep;
- DescriptionLanguage = TestEvent.CalendarAlarmData[1].DescriptionLanguage;
- DescriptionTokens = TestEvent.CalendarAlarmData[1].DescriptionTokens;
+ descriptionData = testEvent.calendarAlarmData[1].descriptionData;
+ descriptionAltRep = testEvent.calendarAlarmData[1].descriptionAltRep;
+ descriptionLanguage = testEvent.calendarAlarmData[1].descriptionLanguage;
+ descriptionTokens = testEvent.calendarAlarmData[1].descriptionTokens;
}
- ASSERT_EQ("DISPLAY", ActionData);
- ASSERT_EQ("FLASHING=LIGHTS", ActionDataTokens);
+ ASSERT_EQ("DISPLAY", actionData);
+ ASSERT_EQ("FLASHING=LIGHTS", actionDataTokens);
- ASSERT_EQ("20160230T110000Z", TriggerData);
- ASSERT_EQ("END", TriggerRelated);
- ASSERT_EQ("DATE-TIME", TriggerValue);
- ASSERT_EQ("PUSH=BUTTON", TriggerTokens);
+ ASSERT_EQ("20160230T110000Z", triggerData);
+ ASSERT_EQ("END", triggerRelated);
+ ASSERT_EQ("DATE-TIME", triggerValue);
+ ASSERT_EQ("PUSH=BUTTON", triggerTokens);
- ASSERT_EQ("PT7H", DurationData);
- ASSERT_EQ("FLYING=YES", DurationTokens);
+ ASSERT_EQ("PT7H", durationData);
+ ASSERT_EQ("FLYING=YES", durationTokens);
- ASSERT_EQ("PT3M", RepeatData);
- ASSERT_EQ("SLEEP=ALWAYS", RepeatTokens);
+ ASSERT_EQ("PT3M", repeatData);
+ ASSERT_EQ("SLEEP=ALWAYS", repeatTokens);
- ASSERT_EQ("This is the second alarm.", DescriptionData);
- ASSERT_EQ("null:nodata", DescriptionAltRep);
- ASSERT_EQ("kw", DescriptionLanguage);
- ASSERT_EQ("TERRIBLE=TOKEN", DescriptionTokens);
+ ASSERT_EQ("This is the second alarm.", descriptionData);
+ ASSERT_EQ("null:nodata", descriptionAltRep);
+ ASSERT_EQ("kw", descriptionLanguage);
+ ASSERT_EQ("TERRIBLE=TOKEN", descriptionTokens);
// Test the first X-Token.
- if (TestEvent.CalendarAlarmData[1].XTokensData.size() > 0){
+ if (testEvent.calendarAlarmData[1].xTokensData.size() > 0){
- XTokenData = TestEvent.CalendarAlarmData[1].XTokensData[0];
- XTokenName = TestEvent.CalendarAlarmData[1].XTokensDataTokens[0];
+ xTokenData = testEvent.calendarAlarmData[1].xTokensData[0];
+ xTokenName = testEvent.calendarAlarmData[1].xTokensDataTokens[0];
}
- ASSERT_EQ("Example Data 1", XTokenData);
- ASSERT_EQ("X-EXAMPLE1;YAY=YES", XTokenName);
+ ASSERT_EQ("Example Data 1", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1;YAY=YES", xTokenName);
// Test the second X-Token.
- XTokenData.clear();
- XTokenName.clear();
+ xTokenData.clear();
+ xTokenName.clear();
- if (TestEvent.CalendarAlarmData[1].XTokensData.size() > 1){
+ if (testEvent.calendarAlarmData[1].xTokensData.size() > 1){
- XTokenData = TestEvent.CalendarAlarmData[1].XTokensData[1];
- XTokenName = TestEvent.CalendarAlarmData[1].XTokensDataTokens[1];
+ xTokenData = testEvent.calendarAlarmData[1].xTokensData[1];
+ xTokenName = testEvent.calendarAlarmData[1].xTokensDataTokens[1];
}
- ASSERT_EQ("Example Data 2", XTokenData);
- ASSERT_EQ("X-EXAMPLE2;NOPE=YEP", XTokenName);
+ ASSERT_EQ("Example Data 2", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2;NOPE=YEP", xTokenName);
// Test the third X-Token.
- XTokenData.clear();
- XTokenName.clear();
+ xTokenData.clear();
+ xTokenName.clear();
- if (TestEvent.CalendarAlarmData[1].XTokensData.size() > 2){
+ if (testEvent.calendarAlarmData[1].xTokensData.size() > 2){
- XTokenData = TestEvent.CalendarAlarmData[1].XTokensData[2];
- XTokenName = TestEvent.CalendarAlarmData[1].XTokensDataTokens[2];
+ xTokenData = testEvent.calendarAlarmData[1].xTokensData[2];
+ xTokenName = testEvent.calendarAlarmData[1].xTokensDataTokens[2];
}
- ASSERT_EQ("Example Data 3", XTokenData);
- ASSERT_EQ("X-EXAMPLE3;WORLD=NO", XTokenName);
+ ASSERT_EQ("Example Data 3", xTokenData);
+ ASSERT_EQ("X-EXAMPLE3;WORLD=NO", xTokenName);
// Tests for the third VALARM property.
- ActionData.clear();
- ActionDataTokens.clear();
+ actionData.clear();
+ actionDataTokens.clear();
- TriggerData.clear();
- TriggerRelated.clear();
- TriggerValue.clear();
- TriggerTokens.clear();
+ triggerData.clear();
+ triggerRelated.clear();
+ triggerValue.clear();
+ triggerTokens.clear();
- DurationData.clear();
- DurationTokens.clear();
+ durationData.clear();
+ durationTokens.clear();
- RepeatData.clear();
- RepeatTokens.clear();
+ repeatData.clear();
+ repeatTokens.clear();
- XTokenData.clear();
- XTokenName.clear();
+ xTokenData.clear();
+ xTokenName.clear();
- DescriptionData.clear();
- DescriptionAltRep.clear();
- DescriptionLanguage.clear();
- DescriptionTokens.clear();
+ descriptionData.clear();
+ descriptionAltRep.clear();
+ descriptionLanguage.clear();
+ descriptionTokens.clear();
- string SummaryData;
- string SummaryAltRep;
- string SummaryLanguage;
- string SummaryTokens;
+ string summaryData;
+ string summaryAltRep;
+ string summaryLanguage;
+ string summaryTokens;
- string AttendeeDataMember;
- string AttendeeDataDelegatedFrom;
- string AttendeeDataDelegatedTo;
- string AttendeeDataRole;
- string AttendeeDataRSVP;
- string AttendeeDataDirectoryEntry;
- string AttendeeDataSentBy;
- string AttendeeDataCommonName;
- string AttendeeDataCalendarUserType;
- string AttendeeDataParticipationStatus;
- string AttendeeDataLanguage;
- string AttendeeDataTokens;
- string AttendeeData;
+ string attendeeDataMember;
+ string attendeeDataDelegatedFrom;
+ string attendeeDataDelegatedTo;
+ string attendeeDataRole;
+ string attendeeDataRSVP;
+ string attendeeDataDirectoryEntry;
+ string attendeeDataSentBy;
+ string attendeeDataCommonName;
+ string attendeeDataCalendarUserType;
+ string attendeeDataParticipationStatus;
+ string attendeeDataLanguage;
+ string attendeeDataTokens;
+ string attendeeData;
- AttachData.clear();
- AttachDataFormatType.clear();
- AttachDataValue.clear();
- AttachDataEncoding.clear();
- AttachDataTokens.clear();
+ attachData.clear();
+ attachDataFormatType.clear();
+ attachDataValue.clear();
+ attachDataEncoding.clear();
+ attachDataTokens.clear();
- if (TestEvent.CalendarAlarmData.size() > 2){
+ if (testEvent.calendarAlarmData.size() > 2){
- ActionData = TestEvent.CalendarAlarmData[2].AlarmAction;
- ActionDataTokens = TestEvent.CalendarAlarmData[2].AlarmActionTokens;
+ actionData = testEvent.calendarAlarmData[2].alarmAction;
+ actionDataTokens = testEvent.calendarAlarmData[2].alarmActionTokens;
- TriggerData = TestEvent.CalendarAlarmData[2].TriggerData;
- TriggerRelated = TestEvent.CalendarAlarmData[2].TriggerRelated;
- TriggerValue = TestEvent.CalendarAlarmData[2].TriggerValue;
- TriggerTokens = TestEvent.CalendarAlarmData[2].TriggerTokens;
+ triggerData = testEvent.calendarAlarmData[2].triggerData;
+ triggerRelated = testEvent.calendarAlarmData[2].triggerRelated;
+ triggerValue = testEvent.calendarAlarmData[2].triggerValue;
+ triggerTokens = testEvent.calendarAlarmData[2].triggerTokens;
- DurationData = TestEvent.CalendarAlarmData[2].DurationData;
- DurationTokens = TestEvent.CalendarAlarmData[2].DurationTokens;
+ durationData = testEvent.calendarAlarmData[2].durationData;
+ durationTokens = testEvent.calendarAlarmData[2].durationTokens;
- RepeatData = TestEvent.CalendarAlarmData[2].RepeatData;
- RepeatTokens = TestEvent.CalendarAlarmData[2].RepeatTokens;
+ repeatData = testEvent.calendarAlarmData[2].repeatData;
+ repeatTokens = testEvent.calendarAlarmData[2].repeatTokens;
- DescriptionData = TestEvent.CalendarAlarmData[2].DescriptionData;
- DescriptionAltRep = TestEvent.CalendarAlarmData[2].DescriptionAltRep;
- DescriptionLanguage = TestEvent.CalendarAlarmData[2].DescriptionLanguage;
- DescriptionTokens = TestEvent.CalendarAlarmData[2].DescriptionTokens;
+ descriptionData = testEvent.calendarAlarmData[2].descriptionData;
+ descriptionAltRep = testEvent.calendarAlarmData[2].descriptionAltRep;
+ descriptionLanguage = testEvent.calendarAlarmData[2].descriptionLanguage;
+ descriptionTokens = testEvent.calendarAlarmData[2].descriptionTokens;
- SummaryData = TestEvent.CalendarAlarmData[2].SummaryData;
- SummaryAltRep = TestEvent.CalendarAlarmData[2].SummaryAltRep;
- SummaryLanguage = TestEvent.CalendarAlarmData[2].SummaryLanguage;
- SummaryTokens = TestEvent.CalendarAlarmData[2].SummaryTokens;
+ summaryData = testEvent.calendarAlarmData[2].summaryData;
+ summaryAltRep = testEvent.calendarAlarmData[2].summaryAltRep;
+ summaryLanguage = testEvent.calendarAlarmData[2].summaryLanguage;
+ summaryTokens = testEvent.calendarAlarmData[2].summaryTokens;
}
- ASSERT_EQ("EMAIL", ActionData);
- ASSERT_EQ("FLASHING=LIGHTS", ActionDataTokens);
+ ASSERT_EQ("EMAIL", actionData);
+ ASSERT_EQ("FLASHING=LIGHTS", actionDataTokens);
- ASSERT_EQ("20160230T120000Z", TriggerData);
- ASSERT_EQ("END", TriggerRelated);
- ASSERT_EQ("DATE-TIME", TriggerValue);
- ASSERT_EQ("PUSH=BUTTON", TriggerTokens);
+ ASSERT_EQ("20160230T120000Z", triggerData);
+ ASSERT_EQ("END", triggerRelated);
+ ASSERT_EQ("DATE-TIME", triggerValue);
+ ASSERT_EQ("PUSH=BUTTON", triggerTokens);
- ASSERT_EQ("PT7H", DurationData);
- ASSERT_EQ("FLYING=YES", DurationTokens);
+ ASSERT_EQ("PT7H", durationData);
+ ASSERT_EQ("FLYING=YES", durationTokens);
- ASSERT_EQ("PT3M", RepeatData);
- ASSERT_EQ("SLEEP=ALWAYS", RepeatTokens);
+ ASSERT_EQ("PT3M", repeatData);
+ ASSERT_EQ("SLEEP=ALWAYS", repeatTokens);
- ASSERT_EQ("This is the third alarm.", DescriptionData);
- ASSERT_EQ("null:nodata", DescriptionAltRep);
- ASSERT_EQ("kw", DescriptionLanguage);
- ASSERT_EQ("TERRIBLE=TOKEN", DescriptionTokens);
+ ASSERT_EQ("This is the third alarm.", descriptionData);
+ ASSERT_EQ("null:nodata", descriptionAltRep);
+ ASSERT_EQ("kw", descriptionLanguage);
+ ASSERT_EQ("TERRIBLE=TOKEN", descriptionTokens);
- ASSERT_EQ("This is the summary of the third alarm.", SummaryData);
- ASSERT_EQ("null:nodata", SummaryAltRep);
- ASSERT_EQ("en", SummaryLanguage);
- ASSERT_EQ("MEEP=MOOP", SummaryTokens);
+ ASSERT_EQ("This is the summary of the third alarm.", summaryData);
+ ASSERT_EQ("null:nodata", summaryAltRep);
+ ASSERT_EQ("en", summaryLanguage);
+ ASSERT_EQ("MEEP=MOOP", summaryTokens);
// Tests for ATTENDEE. First ATTENDEE property.
- if (TestEvent.CalendarAlarmData[2].AttendeeList.begin() != TestEvent.CalendarAlarmData[2].AttendeeList.end()){
+ if (testEvent.calendarAlarmData[2].attendeeList.begin() != testEvent.calendarAlarmData[2].attendeeList.end()){
- AttendeeData = TestEvent.CalendarAlarmData[2].AttendeeList[0];
+ attendeeData = testEvent.calendarAlarmData[2].attendeeList[0];
}
- ASSERT_EQ("Attendee One", AttendeeData);
+ ASSERT_EQ("Attendee One", attendeeData);
// Second ATTENDEE property.
- AttendeeData.clear();
+ attendeeData.clear();
- if (TestEvent.CalendarAlarmData[2].AttendeeList.size() > 1){
+ if (testEvent.calendarAlarmData[2].attendeeList.size() > 1){
- AttendeeData = TestEvent.CalendarAlarmData[2].AttendeeList[1];
+ attendeeData = testEvent.calendarAlarmData[2].attendeeList[1];
}
- if (TestEvent.CalendarAlarmData[2].AttendeeList.size() > 1){
+ if (testEvent.calendarAlarmData[2].attendeeList.size() > 1){
- AttendeeDataDelegatedFrom = TestEvent.CalendarAlarmData[2].AttendeeListDelegatedFrom[1];
+ attendeeDataDelegatedFrom = testEvent.calendarAlarmData[2].attendeeListDelegatedFrom[1];
}
- if (TestEvent.CalendarAlarmData[2].AttendeeList.size() > 1){
+ if (testEvent.calendarAlarmData[2].attendeeList.size() > 1){
- AttendeeDataDelegatedTo = TestEvent.CalendarAlarmData[2].AttendeeListDelegatedTo[1];
+ attendeeDataDelegatedTo = testEvent.calendarAlarmData[2].attendeeListDelegatedTo[1];
}
- if (TestEvent.CalendarAlarmData[2].AttendeeList.size() > 1){
+ if (testEvent.calendarAlarmData[2].attendeeList.size() > 1){
- AttendeeDataRole = TestEvent.CalendarAlarmData[2].AttendeeListRole[1];
+ attendeeDataRole = testEvent.calendarAlarmData[2].attendeeListRole[1];
}
- if (TestEvent.CalendarAlarmData[2].AttendeeList.size() > 1){
+ if (testEvent.calendarAlarmData[2].attendeeList.size() > 1){
- AttendeeDataRSVP = TestEvent.CalendarAlarmData[2].AttendeeListRSVP[1];
+ attendeeDataRSVP = testEvent.calendarAlarmData[2].attendeeListRSVP[1];
}
- ASSERT_EQ("Attendee Two", AttendeeData);
- ASSERT_EQ("mailto:delegated.from@example.com", AttendeeDataDelegatedFrom);
- ASSERT_EQ("mailto:delegated.to@example.com", AttendeeDataDelegatedTo);
- ASSERT_EQ("CHAIR", AttendeeDataRole);
- ASSERT_EQ("TRUE", AttendeeDataRSVP);
+ ASSERT_EQ("Attendee Two", attendeeData);
+ ASSERT_EQ("mailto:delegated.from@example.com", attendeeDataDelegatedFrom);
+ ASSERT_EQ("mailto:delegated.to@example.com", attendeeDataDelegatedTo);
+ ASSERT_EQ("CHAIR", attendeeDataRole);
+ ASSERT_EQ("TRUE", attendeeDataRSVP);
// Third ATTENDEE property.
- AttendeeData.clear();
+ attendeeData.clear();
- if (TestEvent.CalendarAlarmData[2].AttendeeList.size() > 2){
+ if (testEvent.calendarAlarmData[2].attendeeList.size() > 2){
- AttendeeData = TestEvent.CalendarAlarmData[2].AttendeeList[2];
+ attendeeData = testEvent.calendarAlarmData[2].attendeeList[2];
}
- if (TestEvent.CalendarAlarmData[2].AttendeeList.size() > 2){
+ if (testEvent.calendarAlarmData[2].attendeeList.size() > 2){
- AttendeeDataDirectoryEntry = TestEvent.CalendarAlarmData[2].AttendeeListDirectoryEntry[2];
+ attendeeDataDirectoryEntry = testEvent.calendarAlarmData[2].attendeeListDirectoryEntry[2];
}
- if (TestEvent.CalendarAlarmData[2].AttendeeList.size() > 2){
+ if (testEvent.calendarAlarmData[2].attendeeList.size() > 2){
- AttendeeDataSentBy = TestEvent.CalendarAlarmData[2].AttendeeListSentBy[2];
+ attendeeDataSentBy = testEvent.calendarAlarmData[2].attendeeListSentBy[2];
}
- if (TestEvent.CalendarAlarmData[2].AttendeeList.size() > 2){
+ if (testEvent.calendarAlarmData[2].attendeeList.size() > 2){
- AttendeeDataCommonName = TestEvent.CalendarAlarmData[2].AttendeeListCommonName[2];
+ attendeeDataCommonName = testEvent.calendarAlarmData[2].attendeeListCommonName[2];
}
- if (TestEvent.CalendarAlarmData[2].AttendeeList.size() > 2){
+ if (testEvent.calendarAlarmData[2].attendeeList.size() > 2){
- AttendeeDataCalendarUserType = TestEvent.CalendarAlarmData[2].AttendeeListCalendarUserType[2];
+ attendeeDataCalendarUserType = testEvent.calendarAlarmData[2].attendeeListCalendarUserType[2];
}
- if (TestEvent.CalendarAlarmData[2].AttendeeList.size() > 2){
+ if (testEvent.calendarAlarmData[2].attendeeList.size() > 2){
- AttendeeDataParticipationStatus = TestEvent.CalendarAlarmData[2].AttendeeListParticipationStatus[2];
+ attendeeDataParticipationStatus = testEvent.calendarAlarmData[2].attendeeListParticipationStatus[2];
}
- if (TestEvent.CalendarAlarmData[2].AttendeeList.size() > 2){
+ if (testEvent.calendarAlarmData[2].attendeeList.size() > 2){
- AttendeeDataLanguage = TestEvent.CalendarAlarmData[2].AttendeeListLanguage[2];
+ attendeeDataLanguage = testEvent.calendarAlarmData[2].attendeeListLanguage[2];
}
- if (TestEvent.CalendarAlarmData[2].AttendeeList.size() > 2){
+ if (testEvent.calendarAlarmData[2].attendeeList.size() > 2){
- AttendeeDataTokens = TestEvent.CalendarAlarmData[2].AttendeeListTokens[2];
+ attendeeDataTokens = testEvent.calendarAlarmData[2].attendeeListTokens[2];
}
- ASSERT_EQ("Attendee Three", AttendeeData);
- ASSERT_EQ("null:nodata", AttendeeDataDirectoryEntry);
- ASSERT_EQ("mailto:sent.by@example.com", AttendeeDataSentBy);
- ASSERT_EQ("Attendee The Third", AttendeeDataCommonName);
- ASSERT_EQ("INDIVIDUAL", AttendeeDataCalendarUserType);
- ASSERT_EQ("ACCEPTED", AttendeeDataParticipationStatus);
- ASSERT_EQ("kw", AttendeeDataLanguage);
- ASSERT_EQ("EXAMPLE=DATA", AttendeeDataTokens);
+ ASSERT_EQ("Attendee Three", attendeeData);
+ ASSERT_EQ("null:nodata", attendeeDataDirectoryEntry);
+ ASSERT_EQ("mailto:sent.by@example.com", attendeeDataSentBy);
+ ASSERT_EQ("Attendee The Third", attendeeDataCommonName);
+ ASSERT_EQ("INDIVIDUAL", attendeeDataCalendarUserType);
+ ASSERT_EQ("ACCEPTED", attendeeDataParticipationStatus);
+ ASSERT_EQ("kw", attendeeDataLanguage);
+ ASSERT_EQ("EXAMPLE=DATA", attendeeDataTokens);
// Tests for ATTACH. First ATTACH property.
- if (TestEvent.CalendarAlarmData[2].AttachList.begin() != TestEvent.CalendarAlarmData[2].AttachList.end()){
+ if (testEvent.calendarAlarmData[2].attachList.begin() != testEvent.calendarAlarmData[2].attachList.end()){
- AttachData = TestEvent.CalendarAlarmData[2].AttachList[0];
+ attachData = testEvent.calendarAlarmData[2].attachList[0];
}
- if (TestEvent.CalendarAlarmData[2].AttachListFormatType.begin() != TestEvent.CalendarAlarmData[2].AttachListFormatType.end()){
+ if (testEvent.calendarAlarmData[2].attachListFormatType.begin() != testEvent.calendarAlarmData[2].attachListFormatType.end()){
- AttachDataFormatType = TestEvent.CalendarAlarmData[2].AttachListFormatType[0];
+ attachDataFormatType = testEvent.calendarAlarmData[2].attachListFormatType[0];
}
- ASSERT_EQ("http://www.example.com/", AttachData);
- ASSERT_EQ("application/internet-shortcut", AttachDataFormatType);
+ ASSERT_EQ("http://www.example.com/", attachData);
+ ASSERT_EQ("application/internet-shortcut", attachDataFormatType);
// Second ATTACH property.
- AttachData.clear();
- AttachDataFormatType.clear();
- AttachDataValue.clear();
- AttachDataEncoding.clear();
+ attachData.clear();
+ attachDataFormatType.clear();
+ attachDataValue.clear();
+ attachDataEncoding.clear();
- if (TestEvent.CalendarAlarmData[2].AttachList.size() > 1){
+ if (testEvent.calendarAlarmData[2].attachList.size() > 1){
- AttachData = TestEvent.CalendarAlarmData[2].AttachList[1];
+ attachData = testEvent.calendarAlarmData[2].attachList[1];
}
- if (TestEvent.CalendarAlarmData[2].AttachListFormatType.size() > 1){
+ if (testEvent.calendarAlarmData[2].attachListFormatType.size() > 1){
- AttachDataFormatType = TestEvent.CalendarAlarmData[2].AttachListFormatType[1];
+ attachDataFormatType = testEvent.calendarAlarmData[2].attachListFormatType[1];
}
- ASSERT_EQ("http://www.example.com/page2.html", AttachData);
- ASSERT_EQ("application/internet-shortcut", AttachDataFormatType);
+ ASSERT_EQ("http://www.example.com/page2.html", attachData);
+ ASSERT_EQ("application/internet-shortcut", attachDataFormatType);
// Third ATTACH property.
- AttachData.clear();
- AttachDataFormatType.clear();
- AttachDataValue.clear();
- AttachDataEncoding.clear();
- AttachDataTokens.clear();
+ attachData.clear();
+ attachDataFormatType.clear();
+ attachDataValue.clear();
+ attachDataEncoding.clear();
+ attachDataTokens.clear();
- if (TestEvent.CalendarAlarmData[2].AttachList.size() > 2){
+ if (testEvent.calendarAlarmData[2].attachList.size() > 2){
- AttachData = TestEvent.CalendarAlarmData[2].AttachList[2];
+ attachData = testEvent.calendarAlarmData[2].attachList[2];
}
- if (TestEvent.CalendarAlarmData[2].AttachListFormatType.size() > 2){
+ if (testEvent.calendarAlarmData[2].attachListFormatType.size() > 2){
- AttachDataFormatType = TestEvent.CalendarAlarmData[2].AttachListFormatType[2];
+ attachDataFormatType = testEvent.calendarAlarmData[2].attachListFormatType[2];
}
- if (TestEvent.CalendarAlarmData[2].AttachListValue.size() > 2){
+ if (testEvent.calendarAlarmData[2].attachListValue.size() > 2){
- AttachDataValue = TestEvent.CalendarAlarmData[2].AttachListValue[2];
+ attachDataValue = testEvent.calendarAlarmData[2].attachListValue[2];
}
- if (TestEvent.CalendarAlarmData[2].AttachListFormatType.size() > 2){
+ if (testEvent.calendarAlarmData[2].attachListFormatType.size() > 2){
- AttachDataEncoding = TestEvent.CalendarAlarmData[2].AttachListEncoding[2];
+ attachDataEncoding = testEvent.calendarAlarmData[2].attachListEncoding[2];
}
- if (TestEvent.CalendarAlarmData[2].AttachListTokens.size() > 2){
+ if (testEvent.calendarAlarmData[2].attachListTokens.size() > 2){
- AttachDataTokens = TestEvent.CalendarAlarmData[2].AttachListTokens[2];
+ attachDataTokens = testEvent.calendarAlarmData[2].attachListTokens[2];
}
- ASSERT_EQ("VGhpcyBpcyBhbiBleGFtcGxlIGZpbGU=", AttachData);
- ASSERT_EQ("text/plain", AttachDataFormatType);
- ASSERT_EQ("BASE64", AttachDataEncoding);
- ASSERT_EQ("BINARY", AttachDataValue);
- ASSERT_EQ("STUPID=EXAMPLE", AttachDataTokens);
+ ASSERT_EQ("VGhpcyBpcyBhbiBleGFtcGxlIGZpbGU=", attachData);
+ ASSERT_EQ("text/plain", attachDataFormatType);
+ ASSERT_EQ("BASE64", attachDataEncoding);
+ ASSERT_EQ("BINARY", attachDataValue);
+ ASSERT_EQ("STUPID=EXAMPLE", attachDataTokens);
// Test the first X-Token.
- if (TestEvent.CalendarAlarmData[2].XTokensData.size() > 0){
+ if (testEvent.calendarAlarmData[2].xTokensData.size() > 0){
- XTokenData = TestEvent.CalendarAlarmData[2].XTokensData[0];
- XTokenName = TestEvent.CalendarAlarmData[2].XTokensDataTokens[0];
+ xTokenData = testEvent.calendarAlarmData[2].xTokensData[0];
+ xTokenName = testEvent.calendarAlarmData[2].xTokensDataTokens[0];
}
- ASSERT_EQ("Example Data 1", XTokenData);
- ASSERT_EQ("X-EXAMPLE1;YAY=YES", XTokenName);
+ ASSERT_EQ("Example Data 1", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1;YAY=YES", xTokenName);
// Test the second X-Token.
- XTokenData.clear();
- XTokenName.clear();
+ xTokenData.clear();
+ xTokenName.clear();
- if (TestEvent.CalendarAlarmData[2].XTokensData.size() > 1){
+ if (testEvent.calendarAlarmData[2].xTokensData.size() > 1){
- XTokenData = TestEvent.CalendarAlarmData[2].XTokensData[1];
- XTokenName = TestEvent.CalendarAlarmData[2].XTokensDataTokens[1];
+ xTokenData = testEvent.calendarAlarmData[2].xTokensData[1];
+ xTokenName = testEvent.calendarAlarmData[2].xTokensDataTokens[1];
}
- ASSERT_EQ("Example Data 2", XTokenData);
- ASSERT_EQ("X-EXAMPLE2;NOPE=YEP", XTokenName);
+ ASSERT_EQ("Example Data 2", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2;NOPE=YEP", xTokenName);
// Test the third X-Token.
- XTokenData.clear();
- XTokenName.clear();
+ xTokenData.clear();
+ xTokenName.clear();
- if (TestEvent.CalendarAlarmData[2].XTokensData.size() > 2){
+ if (testEvent.calendarAlarmData[2].xTokensData.size() > 2){
- XTokenData = TestEvent.CalendarAlarmData[2].XTokensData[2];
- XTokenName = TestEvent.CalendarAlarmData[2].XTokensDataTokens[2];
+ xTokenData = testEvent.calendarAlarmData[2].xTokensData[2];
+ xTokenName = testEvent.calendarAlarmData[2].xTokensDataTokens[2];
}
- ASSERT_EQ("Example Data 3", XTokenData);
- ASSERT_EQ("X-EXAMPLE3;WORLD=NO", XTokenName);
+ ASSERT_EQ("Example Data 3", xTokenData);
+ ASSERT_EQ("X-EXAMPLE3;WORLD=NO", xTokenName);
}
TEST(iCalendarSaveEvent, SaveEventTests){
- CalendarEventObject TestEvent;
- CalendarEventObject TestEvent2;
- CalendarEventObject TestEvent3;
+ CalendarEventObject testEvent;
+ CalendarEventObject testEvent2;
+ CalendarEventObject testEvent3;
// Load the test event.
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestEvent.LoadFile("iCalendarEvent-Load1.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestEvent.ValidBaseObject());
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testEvent.LoadFile("iCalendarEvent-Load1.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testEvent.ValidBaseObject());
- //ASSERT_EQ(CALENDAROBJECTSAVE_MISSING, TestEvent.LoadFile("iCalendarEvent-Missing.vcf"));
- //ASSERT_EQ(CALENDAROBJECTSAVE_CANNOTOPEN, TestEvent.LoadFile("iCalendarEvent-InvalidPermissions.vcf"));
- //ASSERT_EQ(CALENDAROBJECTSAVE_OK, TestEvent.LoadFile("iCalendarEvent-Load1.vcf"));
+ //ASSERT_EQ(CALENDAROBJECTSAVE_MISSING, testEvent.LoadFile("iCalendarEvent-Missing.vcf"));
+ //ASSERT_EQ(CALENDAROBJECTSAVE_CANNOTOPEN, testEvent.LoadFile("iCalendarEvent-InvalidPermissions.vcf"));
+ //ASSERT_EQ(CALENDAROBJECTSAVE_OK, testEvent.LoadFile("iCalendarEvent-Load1.vcf"));
- ASSERT_EQ(CALENDAROBJECTSAVE_CANNOTOPEN, TestEvent.SaveFile("/stupidfilelocation/dontsavehere.ics"));
+ ASSERT_EQ(CALENDAROBJECTSAVE_CANNOTOPEN, testEvent.SaveFile("/stupidfilelocation/dontsavehere.ics"));
// Save the data to a string and compare the data.
// First contact file.
- std::string SaveDataComparison = "BEGIN:VCALENDAR\n"
+ std::string saveDataComparison = "BEGIN:VCALENDAR\n"
"VERSION:2.0\n"
"METHOD;EXAMPLE=DATA:REQUEST\n"
"CALSCALE;MORE=YES:GREGORIAN\n"
"END:VEVENT\n"
"END:VCALENDAR";
- std::string SaveData;
+ std::string saveData;
- TestEvent.SaveString(&SaveData);
+ testEvent.SaveString(&saveData);
- ASSERT_EQ(SaveDataComparison, SaveData);
+ ASSERT_EQ(saveDataComparison, saveData);
// Process the second calendar item.
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestEvent2.LoadFile("iCalendarEvent-Load2.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestEvent2.ValidBaseObject());
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testEvent2.LoadFile("iCalendarEvent-Load2.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testEvent2.ValidBaseObject());
- SaveData.clear();
- SaveDataComparison = "BEGIN:VCALENDAR\n"
+ saveData.clear();
+ saveDataComparison = "BEGIN:VCALENDAR\n"
"VERSION:2.0\n"
"PRODID:-//Xestia//Calendar Unit Testing//KW\n"
"BEGIN:VEVENT\n"
"END:VEVENT\n"
"END:VCALENDAR";
- TestEvent2.SaveString(&SaveData);
+ testEvent2.SaveString(&saveData);
- ASSERT_EQ(SaveDataComparison, SaveData);
+ ASSERT_EQ(saveDataComparison, saveData);
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestEvent3.LoadFile("iCalendarEvent-Load3.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestEvent3.ValidBaseObject());
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testEvent3.LoadFile("iCalendarEvent-Load3.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testEvent3.ValidBaseObject());
- SaveData.clear();
+ saveData.clear();
- SaveDataComparison = "BEGIN:VCALENDAR\n"
+ saveDataComparison = "BEGIN:VCALENDAR\n"
"VERSION:2.0\n"
"PRODID:-//Xestia//Calendar Unit Testing//KW\n"
"BEGIN:VEVENT\n"
"END:VEVENT\n"
"END:VCALENDAR";
- TestEvent3.SaveString(&SaveData);
+ testEvent3.SaveString(&saveData);
- ASSERT_EQ(SaveDataComparison, SaveData);
+ ASSERT_EQ(saveDataComparison, saveData);
}
\ No newline at end of file
TEST(iCalendarFreeBusy, BasicTests){
- CalendarFreeBusyObject TestFreeBusy;
+ CalendarFreeBusyObject testFreeBusy;
- ASSERT_EQ(CALENDAROBJECTLOAD_MISSING, TestFreeBusy.LoadFile("iCalendarFreeBusy-Missing.vcf"));
- ASSERT_EQ(CALENDAROBJECTLOAD_CANNOTOPEN, TestFreeBusy.LoadFile("iCalendarFreeBusy-InvalidPermissions.vcf"));
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestFreeBusy.LoadFile("iCalendarFreeBusy-Load1.vcf"));
+ ASSERT_EQ(CALENDAROBJECTLOAD_MISSING, testFreeBusy.LoadFile("iCalendarFreeBusy-Missing.vcf"));
+ ASSERT_EQ(CALENDAROBJECTLOAD_CANNOTOPEN, testFreeBusy.LoadFile("iCalendarFreeBusy-InvalidPermissions.vcf"));
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testFreeBusy.LoadFile("iCalendarFreeBusy-Load1.vcf"));
}
TEST(iCalendarFreeBusy, ObjectDataTests){
- CalendarFreeBusyObject TestFreeBusy;
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestFreeBusy.LoadFile("iCalendarFreeBusy-Load2.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestFreeBusy.ValidBaseObject());
+ CalendarFreeBusyObject testFreeBusy;
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testFreeBusy.LoadFile("iCalendarFreeBusy-Load2.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testFreeBusy.ValidBaseObject());
// Tests for DTSTAMP.
- ASSERT_EQ("20160131T173000Z", TestFreeBusy.DateTimeStampData);
- ASSERT_EQ("OTHER=PARAM", TestFreeBusy.DateTimeStampTokens);
+ ASSERT_EQ("20160131T173000Z", testFreeBusy.dateTimeStampData);
+ ASSERT_EQ("OTHER=PARAM", testFreeBusy.dateTimeStampTokens);
// Tests for UID.
- ASSERT_EQ("b3a16392-ad86-4061-be53-c215af2306ff", TestFreeBusy.UniqueID);
- ASSERT_EQ("UNIQUEPARAM=CERTAINLY;OKAY=MAYBENOT", TestFreeBusy.UniqueIDTokens);
+ ASSERT_EQ("b3a16392-ad86-4061-be53-c215af2306ff", testFreeBusy.UniqueID);
+ ASSERT_EQ("UNIQUEPARAM=CERTAINLY;OKAY=MAYBENOT", testFreeBusy.UniqueIDTokens);
// Tests for CONTACT.
- std::string ContactData;
- std::string ContactDataAltRep;
- std::string ContactDataLanguage;
- std::string ContactDataTokens;
+ std::string contactData;
+ std::string contactDataAltRep;
+ std::string contactDataLanguage;
+ std::string contactDataTokens;
- if (TestFreeBusy.ContactList.size() > 0){
+ if (testFreeBusy.contactList.size() > 0){
- ContactData = TestFreeBusy.ContactList[0];
+ contactData = testFreeBusy.contactList[0];
}
- if (TestFreeBusy.ContactList.size() > 0){
+ if (testFreeBusy.contactList.size() > 0){
- ContactDataAltRep = TestFreeBusy.ContactListAltRep[0];
+ contactDataAltRep = testFreeBusy.contactListAltRep[0];
}
- if (TestFreeBusy.ContactList.size() > 0){
+ if (testFreeBusy.contactList.size() > 0){
- ContactDataLanguage = TestFreeBusy.ContactListLanguage[0];
+ contactDataLanguage = testFreeBusy.contactListLanguage[0];
}
- if (TestFreeBusy.ContactList.size() > 0){
+ if (testFreeBusy.contactList.size() > 0){
- ContactDataTokens = TestFreeBusy.ContactListTokens[0];
+ contactDataTokens = testFreeBusy.contactListTokens[0];
}
- ASSERT_EQ("Contact Person", ContactData);
- ASSERT_EQ("null:nodata", ContactDataAltRep);
- ASSERT_EQ("en-GB", ContactDataLanguage);
- ASSERT_EQ("EXAMPLE=TOKEN", ContactDataTokens);
+ ASSERT_EQ("Contact Person", contactData);
+ ASSERT_EQ("null:nodata", contactDataAltRep);
+ ASSERT_EQ("en-GB", contactDataLanguage);
+ ASSERT_EQ("EXAMPLE=TOKEN", contactDataTokens);
// Tests for DTSTART.
- ASSERT_EQ("20160131T103000Z", TestFreeBusy.DateTimeStartData);
- ASSERT_EQ("DATE-TIME", TestFreeBusy.DateTimeStartDataValue);
- ASSERT_EQ("Europe/Truro", TestFreeBusy.DateTimeStartDataTimeZoneID);
- ASSERT_EQ("PARAMONE=YES;PARAMTWO=NO", TestFreeBusy.DateTimeStartDataTokens);
+ ASSERT_EQ("20160131T103000Z", testFreeBusy.dateTimeStartData);
+ ASSERT_EQ("DATE-TIME", testFreeBusy.dateTimeStartDataValue);
+ ASSERT_EQ("Europe/Truro", testFreeBusy.dateTimeStartDataTimeZoneID);
+ ASSERT_EQ("PARAMONE=YES;PARAMTWO=NO", testFreeBusy.dateTimeStartDataTokens);
// Tests for DTEND.
- ASSERT_EQ("20160131T183000Z", TestFreeBusy.DateTimeEndData);
- ASSERT_EQ("DATE-TIME", TestFreeBusy.DateTimeEndDataValue);
- ASSERT_EQ("Europe/Truro", TestFreeBusy.DateTimeEndDataTimeZoneID);
- ASSERT_EQ("PARAMFOUR=YES;PARAMTHREE=NO", TestFreeBusy.DateTimeEndDataTokens);
+ ASSERT_EQ("20160131T183000Z", testFreeBusy.dateTimeEndData);
+ ASSERT_EQ("DATE-TIME", testFreeBusy.dateTimeEndDataValue);
+ ASSERT_EQ("Europe/Truro", testFreeBusy.dateTimeEndDataTimeZoneID);
+ ASSERT_EQ("PARAMFOUR=YES;PARAMTHREE=NO", testFreeBusy.dateTimeEndDataTokens);
// Tests for ORGANIZER.
- ASSERT_EQ("mailto:organiser@example.com", TestFreeBusy.OrganiserData);
- ASSERT_EQ("ExampleOrganiser", TestFreeBusy.OrganiserDataCommonName);
- ASSERT_EQ("null:nodata", TestFreeBusy.OrganiserDataDirectoryEntry);
- ASSERT_EQ("mailto:organiser.noreply@example.com", TestFreeBusy.OrganiserDataSentByParam);
- ASSERT_EQ("kw", TestFreeBusy.OrganiserDataLanguage);
- ASSERT_EQ("HAPPY=DAYS", TestFreeBusy.OrganiserDataTokens);
+ ASSERT_EQ("mailto:organiser@example.com", testFreeBusy.organiserData);
+ ASSERT_EQ("ExampleOrganiser", testFreeBusy.organiserDataCommonName);
+ ASSERT_EQ("null:nodata", testFreeBusy.organiserDataDirectoryEntry);
+ ASSERT_EQ("mailto:organiser.noreply@example.com", testFreeBusy.organiserDataSentByParam);
+ ASSERT_EQ("kw", testFreeBusy.organiserDataLanguage);
+ ASSERT_EQ("HAPPY=DAYS", testFreeBusy.organiserDataTokens);
// Tests for URL.
- ASSERT_EQ("http://www.example.com/", TestFreeBusy.URLData);
- ASSERT_EQ("EXTERNAL=YES", TestFreeBusy.URLDataTokens);
+ ASSERT_EQ("http://www.example.com/", testFreeBusy.urlData);
+ ASSERT_EQ("EXTERNAL=YES", testFreeBusy.urlDataTokens);
// Tests for ATTENDEE. First ATTENDEE property.
- std::string AttendeeDataMember;
- std::string AttendeeDataDelegatedFrom;
- std::string AttendeeDataDelegatedTo;
- std::string AttendeeDataRole;
- std::string AttendeeDataRSVP;
- std::string AttendeeDataDirectoryEntry;
- std::string AttendeeDataSentBy;
- std::string AttendeeDataCommonName;
- std::string AttendeeDataCalendarUserType;
- std::string AttendeeDataParticipationStatus;
- std::string AttendeeDataLanguage;
- std::string AttendeeDataTokens;
- std::string AttendeeData;
+ std::string attendeeDataMember;
+ std::string attendeeDataDelegatedFrom;
+ std::string attendeeDataDelegatedTo;
+ std::string attendeeDataRole;
+ std::string attendeeDataRSVP;
+ std::string attendeeDataDirectoryEntry;
+ std::string attendeeDataSentBy;
+ std::string attendeeDataCommonName;
+ std::string attendeeDataCalendarUserType;
+ std::string attendeeDataParticipationStatus;
+ std::string attendeeDataLanguage;
+ std::string attendeeDataTokens;
+ std::string attendeeData;
- if (TestFreeBusy.AttendeeList.begin() != TestFreeBusy.AttendeeList.end()){
+ if (testFreeBusy.attendeeList.begin() != testFreeBusy.attendeeList.end()){
- AttendeeData = TestFreeBusy.AttendeeList[0];
+ attendeeData = testFreeBusy.attendeeList[0];
}
- ASSERT_EQ("Attendee One", AttendeeData);
+ ASSERT_EQ("attendee One", attendeeData);
// Second ATTENDEE property.
- AttendeeData.clear();
+ attendeeData.clear();
- if (TestFreeBusy.AttendeeList.size() > 1){
+ if (testFreeBusy.attendeeList.size() > 1){
- AttendeeData = TestFreeBusy.AttendeeList[1];
+ attendeeData = testFreeBusy.attendeeList[1];
}
- if (TestFreeBusy.AttendeeList.size() > 1){
+ if (testFreeBusy.attendeeList.size() > 1){
- AttendeeDataDelegatedFrom = TestFreeBusy.AttendeeListDelegatedFrom[1];
+ attendeeDataDelegatedFrom = testFreeBusy.attendeeListDelegatedFrom[1];
}
- if (TestFreeBusy.AttendeeList.size() > 1){
+ if (testFreeBusy.attendeeList.size() > 1){
- AttendeeDataDelegatedTo = TestFreeBusy.AttendeeListDelegatedTo[1];
+ attendeeDataDelegatedTo = testFreeBusy.attendeeListDelegatedTo[1];
}
- if (TestFreeBusy.AttendeeList.size() > 1){
+ if (testFreeBusy.attendeeList.size() > 1){
- AttendeeDataRole = TestFreeBusy.AttendeeListRole[1];
+ attendeeDataRole = testFreeBusy.attendeeListRole[1];
}
- if (TestFreeBusy.AttendeeList.size() > 1){
+ if (testFreeBusy.attendeeList.size() > 1){
- AttendeeDataRSVP = TestFreeBusy.AttendeeListRSVP[1];
+ attendeeDataRSVP = testFreeBusy.attendeeListRSVP[1];
}
- ASSERT_EQ("Attendee Two", AttendeeData);
- ASSERT_EQ("mailto:delegated.from@example.com", AttendeeDataDelegatedFrom);
- ASSERT_EQ("mailto:delegated.to@example.com", AttendeeDataDelegatedTo);
- ASSERT_EQ("CHAIR", AttendeeDataRole);
- ASSERT_EQ("TRUE", AttendeeDataRSVP);
+ ASSERT_EQ("Attendee Two", attendeeData);
+ ASSERT_EQ("mailto:delegated.from@example.com", attendeeDataDelegatedFrom);
+ ASSERT_EQ("mailto:delegated.to@example.com", attendeeDataDelegatedTo);
+ ASSERT_EQ("CHAIR", attendeeDataRole);
+ ASSERT_EQ("TRUE", attendeeDataRSVP);
// Third ATTENDEE property.
- AttendeeData.clear();
+ attendeeData.clear();
- if (TestFreeBusy.AttendeeList.size() > 2){
+ if (testFreeBusy.attendeeList.size() > 2){
- AttendeeData = TestFreeBusy.AttendeeList[2];
+ attendeeData = testFreeBusy.attendeeList[2];
}
- if (TestFreeBusy.AttendeeList.size() > 2){
+ if (testFreeBusy.attendeeList.size() > 2){
- AttendeeDataDirectoryEntry = TestFreeBusy.AttendeeListDirectoryEntry[2];
+ attendeeDataDirectoryEntry = testFreeBusy.attendeeListDirectoryEntry[2];
}
- if (TestFreeBusy.AttendeeList.size() > 2){
+ if (testFreeBusy.attendeeList.size() > 2){
- AttendeeDataSentBy = TestFreeBusy.AttendeeListSentBy[2];
+ attendeeDataSentBy = testFreeBusy.attendeeListSentBy[2];
}
- if (TestFreeBusy.AttendeeList.size() > 2){
+ if (testFreeBusy.attendeeList.size() > 2){
- AttendeeDataCommonName = TestFreeBusy.AttendeeListCommonName[2];
+ attendeeDataCommonName = testFreeBusy.attendeeListCommonName[2];
}
- if (TestFreeBusy.AttendeeList.size() > 2){
+ if (testFreeBusy.attendeeList.size() > 2){
- AttendeeDataCalendarUserType = TestFreeBusy.AttendeeListCalendarUserType[2];
+ attendeeDataCalendarUserType = testFreeBusy.attendeeListCalendarUserType[2];
}
- if (TestFreeBusy.AttendeeList.size() > 2){
+ if (testFreeBusy.attendeeList.size() > 2){
- AttendeeDataParticipationStatus = TestFreeBusy.AttendeeListParticipationStatus[2];
+ attendeeDataParticipationStatus = testFreeBusy.attendeeListParticipationStatus[2];
}
- if (TestFreeBusy.AttendeeList.size() > 2){
+ if (testFreeBusy.attendeeList.size() > 2){
- AttendeeDataLanguage = TestFreeBusy.AttendeeListLanguage[2];
+ attendeeDataLanguage = testFreeBusy.attendeeListLanguage[2];
}
- if (TestFreeBusy.AttendeeList.size() > 2){
+ if (testFreeBusy.attendeeList.size() > 2){
- AttendeeDataTokens = TestFreeBusy.AttendeeListTokens[2];
+ attendeeDataTokens = testFreeBusy.attendeeListTokens[2];
}
- ASSERT_EQ("Attendee Three", AttendeeData);
- ASSERT_EQ("null:nodata", AttendeeDataDirectoryEntry);
- ASSERT_EQ("mailto:sent.by@example.com", AttendeeDataSentBy);
- ASSERT_EQ("Attendee The Third", AttendeeDataCommonName);
- ASSERT_EQ("INDIVIDUAL", AttendeeDataCalendarUserType);
- ASSERT_EQ("ACCEPTED", AttendeeDataParticipationStatus);
- ASSERT_EQ("kw", AttendeeDataLanguage);
- ASSERT_EQ("EXAMPLE=DATA", AttendeeDataTokens);
+ ASSERT_EQ("Attendee Three", attendeeData);
+ ASSERT_EQ("null:nodata", attendeeDataDirectoryEntry);
+ ASSERT_EQ("mailto:sent.by@example.com", attendeeDataSentBy);
+ ASSERT_EQ("Attendee The Third", attendeeDataCommonName);
+ ASSERT_EQ("INDIVIDUAL", attendeeDataCalendarUserType);
+ ASSERT_EQ("ACCEPTED", attendeeDataParticipationStatus);
+ ASSERT_EQ("kw", attendeeDataLanguage);
+ ASSERT_EQ("EXAMPLE=DATA", attendeeDataTokens);
// Get the first COMMENT.
- std::string CommentData;
+ std::string commentData;
- if (TestFreeBusy.CommentList.begin() != TestFreeBusy.CommentList.end()){
+ if (testFreeBusy.commentList.begin() != testFreeBusy.commentList.end()){
- CommentData = TestFreeBusy.CommentList[0];
+ commentData = testFreeBusy.commentList[0];
}
- ASSERT_EQ("This is the first comment.", CommentData);
+ ASSERT_EQ("This is the first comment.", commentData);
// Get the second COMMENT.
- CommentData.clear();
+ commentData.clear();
- std::string CommentDataAltRep;
- std::string CommentDataLanguage;
+ std::string commentDataAltRep;
+ std::string commentDataLanguage;
- if (TestFreeBusy.CommentList.size() > 1){
+ if (testFreeBusy.commentList.size() > 1){
- CommentData = TestFreeBusy.CommentList[1];
+ commentData = testFreeBusy.commentList[1];
}
- if (TestFreeBusy.CommentList.size() > 1){
+ if (testFreeBusy.commentList.size() > 1){
- CommentDataAltRep = TestFreeBusy.CommentListAltRep[1];
+ commentDataAltRep = testFreeBusy.commentListAltRep[1];
}
- if (TestFreeBusy.CommentList.size() > 1){
+ if (testFreeBusy.commentList.size() > 1){
- CommentDataLanguage = TestFreeBusy.CommentListLanguage[1];
+ commentDataLanguage = testFreeBusy.commentListLanguage[1];
}
- ASSERT_EQ("This is the second comment.", CommentData);
- ASSERT_EQ("null:nodata", CommentDataAltRep);
- ASSERT_EQ("en", CommentDataLanguage);
+ ASSERT_EQ("This is the second comment.", commentData);
+ ASSERT_EQ("null:nodata", commentDataAltRep);
+ ASSERT_EQ("en", commentDataLanguage);
// Get the third COMMENT.
- CommentData.clear();
+ commentData.clear();
- std::string CommentDataTokens;
+ std::string commentDataTokens;
- if (TestFreeBusy.CommentList.size() > 2){
+ if (testFreeBusy.commentList.size() > 2){
- CommentData = TestFreeBusy.CommentList[2];
+ commentData = testFreeBusy.commentList[2];
}
- if (TestFreeBusy.CommentList.size() > 2){
+ if (testFreeBusy.commentList.size() > 2){
- CommentDataTokens = TestFreeBusy.CommentListTokens[2];
+ commentDataTokens = testFreeBusy.commentListTokens[2];
}
- ASSERT_EQ("This is the third comment.", CommentData);
- ASSERT_EQ("ZEBRAS=YES", CommentDataTokens);
+ ASSERT_EQ("This is the third comment.", commentData);
+ ASSERT_EQ("ZEBRAS=YES", commentDataTokens);
// Get the first FREEBUSY.
- std::string FreeBusyData;
+ std::string freeBusyData;
- if (TestFreeBusy.FreeBusyList.begin() != TestFreeBusy.FreeBusyList.end()){
+ if (testFreeBusy.FreeBusyList.begin() != testFreeBusy.FreeBusyList.end()){
- FreeBusyData = TestFreeBusy.FreeBusyList[0];
+ freeBusyData = testFreeBusy.FreeBusyList[0];
}
- ASSERT_EQ("20160202T210000Z/PT1H", FreeBusyData);
+ ASSERT_EQ("20160202T210000Z/PT1H", freeBusyData);
// Get the second FREEBUSY.
- FreeBusyData.clear();
+ freeBusyData.clear();
- std::string FreeBusyType;
+ std::string freeBusyType;
- if (TestFreeBusy.FreeBusyList.size() > 1){
+ if (testFreeBusy.FreeBusyList.size() > 1){
- FreeBusyData = TestFreeBusy.FreeBusyList[1];
+ freeBusyData = testFreeBusy.FreeBusyList[1];
}
- if (TestFreeBusy.FreeBusyListType.size() > 1){
+ if (testFreeBusy.FreeBusyListType.size() > 1){
- FreeBusyType = TestFreeBusy.FreeBusyListType[1];
+ freeBusyType = testFreeBusy.FreeBusyListType[1];
}
- ASSERT_EQ("FREE", FreeBusyType);
- ASSERT_EQ("20160202T220000Z/PT1H", FreeBusyData);
+ ASSERT_EQ("FREE", freeBusyType);
+ ASSERT_EQ("20160202T220000Z/PT1H", freeBusyData);
// Get the third FREEBUSY.
- FreeBusyData.clear();
- FreeBusyType.clear();
+ freeBusyData.clear();
+ freeBusyType.clear();
std::string FreeBusyTokens;
- if (TestFreeBusy.FreeBusyList.size() > 2){
+ if (testFreeBusy.FreeBusyList.size() > 2){
- FreeBusyData = TestFreeBusy.FreeBusyList[2];
+ freeBusyData = testFreeBusy.FreeBusyList[2];
}
- if (TestFreeBusy.FreeBusyListType.size() > 2){
+ if (testFreeBusy.FreeBusyListType.size() > 2){
- FreeBusyType = TestFreeBusy.FreeBusyListType[2];
+ freeBusyType = testFreeBusy.FreeBusyListType[2];
}
- if (TestFreeBusy.FreeBusyListTokens.size() > 2){
+ if (testFreeBusy.FreeBusyListTokens.size() > 2){
- FreeBusyTokens = TestFreeBusy.FreeBusyListTokens[2];
+ FreeBusyTokens = testFreeBusy.FreeBusyListTokens[2];
}
- ASSERT_EQ("BUSY-UNAVAILABLE", FreeBusyType);
- ASSERT_EQ("20160202T230000Z/PT9H", FreeBusyData);
+ ASSERT_EQ("BUSY-UNAVAILABLE", freeBusyType);
+ ASSERT_EQ("20160202T230000Z/PT9H", freeBusyData);
ASSERT_EQ("RESULT=ARGH;TEST=YES", FreeBusyTokens);
// Get the first REQUEST-STATUS.
- std::string RequestStatus;
+ std::string requestStatus;
- if (TestFreeBusy.RequestStatusData.begin() != TestFreeBusy.RequestStatusData.end()){
+ if (testFreeBusy.requestStatusData.begin() != testFreeBusy.requestStatusData.end()){
- RequestStatus = TestFreeBusy.RequestStatusData[0];
+ requestStatus = testFreeBusy.requestStatusData[0];
}
- ASSERT_EQ("2.0;Success", RequestStatus);
+ ASSERT_EQ("2.0;Success", requestStatus);
// Get the second REQUEST-STATUS.
- RequestStatus.clear();
+ requestStatus.clear();
- std::string RequestLanguage;
+ std::string requestLanguage;
- if (TestFreeBusy.RequestStatusData.size() > 1){
+ if (testFreeBusy.requestStatusData.size() > 1){
- RequestStatus = TestFreeBusy.RequestStatusData[1];
+ requestStatus = testFreeBusy.requestStatusData[1];
}
- if (TestFreeBusy.RequestStatusData.size() > 1){
+ if (testFreeBusy.requestStatusData.size() > 1){
- RequestLanguage = TestFreeBusy.RequestStatusLanguage[1];
+ requestLanguage = testFreeBusy.requestStatusLanguage[1];
}
- ASSERT_EQ("3.42;Really big irrecoverable error caused by the user", RequestStatus);
- ASSERT_EQ("en", RequestLanguage);
+ ASSERT_EQ("3.42;Really big irrecoverable error caused by the user", requestStatus);
+ ASSERT_EQ("en", requestLanguage);
// Get the third REQUEST-STATUS.
- RequestStatus.clear();
+ requestStatus.clear();
- std::string RequestTokens;
+ std::string requestTokens;
- if (TestFreeBusy.RequestStatusData.size() > 2){
+ if (testFreeBusy.requestStatusData.size() > 2){
- RequestStatus = TestFreeBusy.RequestStatusData[2];
+ requestStatus = testFreeBusy.requestStatusData[2];
}
- if (TestFreeBusy.RequestStatusData.size() > 2){
+ if (testFreeBusy.requestStatusData.size() > 2){
- RequestTokens = TestFreeBusy.RequestStatusTokens[2];
+ requestTokens = testFreeBusy.requestStatusTokens[2];
}
- ASSERT_EQ("3.7;Invalid calendar user", RequestStatus);
- ASSERT_EQ("USER=MISSING", RequestTokens);
+ ASSERT_EQ("3.7;Invalid calendar user", requestStatus);
+ ASSERT_EQ("USER=MISSING", requestTokens);
// Get the first X-EXAMPLE1 token.
- std::string XTokenName;
- std::string XTokenData;
+ std::string xTokenName;
+ std::string xTokenData;
- if (TestFreeBusy.XTokensData.size() != 0 ){
+ if (testFreeBusy.xTokensData.size() != 0 ){
- XTokenData = TestFreeBusy.XTokensData[0];
+ xTokenData = testFreeBusy.xTokensData[0];
}
- if (TestFreeBusy.XTokensData.size() != 0){
+ if (testFreeBusy.xTokensData.size() != 0){
- XTokenName = TestFreeBusy.XTokensDataTokens[0];
+ xTokenName = testFreeBusy.xTokensDataTokens[0];
}
- ASSERT_EQ("Moo", XTokenData);
- ASSERT_EQ("X-EXAMPLE1", XTokenName);
+ ASSERT_EQ("Moo", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1", xTokenName);
// Get the second X-EXAMPLE1 token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestFreeBusy.XTokensData.size() > 1){
+ if (testFreeBusy.xTokensData.size() > 1){
- XTokenData = TestFreeBusy.XTokensData[1];
+ xTokenData = testFreeBusy.xTokensData[1];
}
- if (TestFreeBusy.XTokensData.size() > 1){
+ if (testFreeBusy.xTokensData.size() > 1){
- XTokenName = TestFreeBusy.XTokensDataTokens[1];
+ xTokenName = testFreeBusy.xTokensDataTokens[1];
}
- ASSERT_EQ("Meep", XTokenData);
- ASSERT_EQ("X-EXAMPLE1;ANIMAL=NOPE", XTokenName);
+ ASSERT_EQ("Meep", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1;ANIMAL=NOPE", xTokenName);
// Get the third X-EXAMPLE1 token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestFreeBusy.XTokensData.size() > 2){
+ if (testFreeBusy.xTokensData.size() > 2){
- XTokenData = TestFreeBusy.XTokensData[2];
+ xTokenData = testFreeBusy.xTokensData[2];
}
- if (TestFreeBusy.XTokensData.size() > 2){
+ if (testFreeBusy.xTokensData.size() > 2){
- XTokenName = TestFreeBusy.XTokensDataTokens[2];
+ xTokenName = testFreeBusy.xTokensDataTokens[2];
}
- ASSERT_EQ("Meow", XTokenData);
- ASSERT_EQ("X-EXAMPLE1;ANIMAL=CAT", XTokenName);
+ ASSERT_EQ("Meow", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1;ANIMAL=CAT", xTokenName);
// Get the first X-EXAMPLE2 token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestFreeBusy.XTokensData.size() > 3){
+ if (testFreeBusy.xTokensData.size() > 3){
- XTokenData = TestFreeBusy.XTokensData[3];
+ xTokenData = testFreeBusy.xTokensData[3];
}
- if (TestFreeBusy.XTokensData.size() > 3){
+ if (testFreeBusy.xTokensData.size() > 3){
- XTokenName = TestFreeBusy.XTokensDataTokens[3];
+ xTokenName = testFreeBusy.xTokensDataTokens[3];
}
- ASSERT_EQ("Dish", XTokenData);
- ASSERT_EQ("X-EXAMPLE2", XTokenName);
+ ASSERT_EQ("Dish", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2", xTokenName);
// Get the second X-EXAMPLE2 token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestFreeBusy.XTokensData.size() > 4){
+ if (testFreeBusy.xTokensData.size() > 4){
- XTokenData = TestFreeBusy.XTokensData[4];
+ xTokenData = testFreeBusy.xTokensData[4];
}
- if (TestFreeBusy.XTokensData.size() > 4){
+ if (testFreeBusy.xTokensData.size() > 4){
- XTokenName = TestFreeBusy.XTokensDataTokens[4];
+ xTokenName = testFreeBusy.xTokensDataTokens[4];
}
- ASSERT_EQ("Fork", XTokenData);
- ASSERT_EQ("X-EXAMPLE2;OBJECT=KITCHEN", XTokenName);
+ ASSERT_EQ("Fork", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2;OBJECT=KITCHEN", xTokenName);
// Get the third X-EXAMPLE2 token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestFreeBusy.XTokensData.size() > 5){
+ if (testFreeBusy.xTokensData.size() > 5){
- XTokenData = TestFreeBusy.XTokensData[5];
+ xTokenData = testFreeBusy.xTokensData[5];
}
- if (TestFreeBusy.XTokensData.size() > 5){
+ if (testFreeBusy.xTokensData.size() > 5){
- XTokenName = TestFreeBusy.XTokensDataTokens[5];
+ xTokenName = testFreeBusy.xTokensDataTokens[5];
}
- ASSERT_EQ("Table", XTokenData);
- ASSERT_EQ("X-EXAMPLE2;OBJECT=LIVINGROOM", XTokenName);
+ ASSERT_EQ("Table", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2;OBJECT=LIVINGROOM", xTokenName);
// Get the X-STATUS token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestFreeBusy.XTokensData.size() > 6){
+ if (testFreeBusy.xTokensData.size() > 6){
- XTokenData = TestFreeBusy.XTokensData[6];
+ xTokenData = testFreeBusy.xTokensData[6];
}
- if (TestFreeBusy.XTokensData.size() > 6){
+ if (testFreeBusy.xTokensData.size() > 6){
- XTokenName = TestFreeBusy.XTokensDataTokens[6];
+ xTokenName = testFreeBusy.xTokensDataTokens[6];
}
- ASSERT_EQ("Idle", XTokenData);
- ASSERT_EQ("X-STATUS;HOLIDAY=YES", XTokenName);
+ ASSERT_EQ("Idle", xTokenData);
+ ASSERT_EQ("X-STATUS;HOLIDAY=YES", xTokenName);
// Get the X-TRANSPORT token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestFreeBusy.XTokensData.size() > 7){
+ if (testFreeBusy.xTokensData.size() > 7){
- XTokenData = TestFreeBusy.XTokensData[7];
+ xTokenData = testFreeBusy.xTokensData[7];
}
- if (TestFreeBusy.XTokensData.size() > 7){
+ if (testFreeBusy.xTokensData.size() > 7){
- XTokenName = TestFreeBusy.XTokensDataTokens[7];
+ xTokenName = testFreeBusy.xTokensDataTokens[7];
}
- ASSERT_EQ("Private Hire", XTokenData);
- ASSERT_EQ("X-TRANSPORT;PUBLIC=NO", XTokenName);
+ ASSERT_EQ("Private Hire", xTokenData);
+ ASSERT_EQ("X-TRANSPORT;PUBLIC=NO", xTokenName);
// Get the X-PHANTOM-STATUS token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestFreeBusy.XTokensData.size() > 8){
+ if (testFreeBusy.xTokensData.size() > 8){
- XTokenData = TestFreeBusy.XTokensData[8];
+ xTokenData = testFreeBusy.xTokensData[8];
}
- if (TestFreeBusy.XTokensData.size() > 8){
+ if (testFreeBusy.xTokensData.size() > 8){
- XTokenName = TestFreeBusy.XTokensDataTokens[8];
+ xTokenName = testFreeBusy.xTokensDataTokens[8];
}
- ASSERT_EQ("None", XTokenData);
- ASSERT_EQ("X-PHANTOM-STATUS;HELP=NONE", XTokenName);
+ ASSERT_EQ("None", xTokenData);
+ ASSERT_EQ("X-PHANTOM-STATUS;HELP=NONE", xTokenName);
}
\ No newline at end of file
TEST(iCalendarSaveFreeBusy, SaveFreeBusyTests){
- CalendarFreeBusyObject TestFreeBusy;
- CalendarFreeBusyObject TestFreeBusy2;
+ CalendarFreeBusyObject testFreeBusy;
+ CalendarFreeBusyObject testFreeBusy2;
// Load the test free/busy information.
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestFreeBusy.LoadFile("iCalendarFreeBusy-Load1.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestFreeBusy.ValidBaseObject());
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testFreeBusy.LoadFile("iCalendarFreeBusy-Load1.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testFreeBusy.ValidBaseObject());
- ASSERT_EQ(CALENDAROBJECTSAVE_CANNOTOPEN, TestFreeBusy.SaveFile("/stupidfilelocation/dontsavehere.ics"));
+ ASSERT_EQ(CALENDAROBJECTSAVE_CANNOTOPEN, testFreeBusy.SaveFile("/stupidfilelocation/dontsavehere.ics"));
// First Free/Busy file.
- std::string SaveDataComparison = "BEGIN:VCALENDAR\n"
+ std::string saveDataComparison = "BEGIN:VCALENDAR\n"
"VERSION:2.0\n"
"PRODID:-//Xestia//Calendar Unit Testing//KW\n"
"BEGIN:VFREEBUSY\n"
"END:VFREEBUSY\n"
"END:VCALENDAR";
- std::string SaveData;
+ std::string saveData;
- TestFreeBusy.SaveString(&SaveData);
+ testFreeBusy.SaveString(&saveData);
- ASSERT_EQ(SaveDataComparison, SaveData);
+ ASSERT_EQ(saveDataComparison, saveData);
- SaveData.clear();
+ saveData.clear();
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestFreeBusy2.LoadFile("iCalendarFreeBusy-Load2.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestFreeBusy2.ValidBaseObject());
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testFreeBusy2.LoadFile("iCalendarFreeBusy-Load2.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testFreeBusy2.ValidBaseObject());
- SaveDataComparison = "BEGIN:VCALENDAR\n"
+ saveDataComparison = "BEGIN:VCALENDAR\n"
"VERSION:2.0\n"
"PRODID:-//Xestia//Calendar Unit Testing//KW\n"
"BEGIN:VFREEBUSY\n"
"END:VFREEBUSY\n"
"END:VCALENDAR";
- TestFreeBusy2.SaveString(&SaveData);
+ testFreeBusy2.SaveString(&saveData);
- ASSERT_EQ(SaveDataComparison, SaveData);
+ ASSERT_EQ(saveDataComparison, saveData);
}
\ No newline at end of file
TEST(iCalendarJournal, BasicTests){
- CalendarJournalObject TestJournal;
+ CalendarJournalObject testJournal;
- ASSERT_EQ(CALENDAROBJECTLOAD_MISSING, TestJournal.LoadFile("iCalendarJournal-Missing.vcf"));
- ASSERT_EQ(CALENDAROBJECTLOAD_CANNOTOPEN, TestJournal.LoadFile("iCalendarJournal-InvalidPermissions.vcf"));
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestJournal.LoadFile("iCalendarJournal-Load1.vcf"));
+ ASSERT_EQ(CALENDAROBJECTLOAD_MISSING, testJournal.LoadFile("iCalendarJournal-Missing.vcf"));
+ ASSERT_EQ(CALENDAROBJECTLOAD_CANNOTOPEN, testJournal.LoadFile("iCalendarJournal-InvalidPermissions.vcf"));
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testJournal.LoadFile("iCalendarJournal-Load1.vcf"));
}
TEST(iCalendarJournal, ObjectDataTests){
- CalendarJournalObject TestJournal;
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestJournal.LoadFile("iCalendarJournal-Load2.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestJournal.ValidBaseObject());
+ CalendarJournalObject testJournal;
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testJournal.LoadFile("iCalendarJournal-Load2.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testJournal.ValidBaseObject());
// Tests for DTSTAMP.
- ASSERT_EQ("20160131T141500Z", TestJournal.DateTimeStampData);
- ASSERT_EQ("OTHER=PARAM", TestJournal.DateTimeStampTokens);
+ ASSERT_EQ("20160131T141500Z", testJournal.dateTimeStampData);
+ ASSERT_EQ("OTHER=PARAM", testJournal.dateTimeStampTokens);
// Tests for UID.
- ASSERT_EQ("b3a16392-ad86-4061-be53-c215af2306c1", TestJournal.UniqueID);
- ASSERT_EQ("UNIQUEPARAM=CERTAINLY;OKAY=MAYBENOT", TestJournal.UniqueIDTokens);
+ ASSERT_EQ("b3a16392-ad86-4061-be53-c215af2306c1", testJournal.uniqueID);
+ ASSERT_EQ("UNIQUEPARAM=CERTAINLY;OKAY=MAYBENOT", testJournal.uniqueIDTokens);
// Tests for CLASS.
- ASSERT_EQ("PUBLIC", TestJournal.ClassData);
- ASSERT_EQ("CHOCOLATE=BAR", TestJournal.ClassDataTokens);
+ ASSERT_EQ("PUBLIC", testJournal.classData);
+ ASSERT_EQ("CHOCOLATE=BAR", testJournal.classDataTokens);
// Tests for DTSTART.
- ASSERT_EQ("20160131T143500Z", TestJournal.DateTimeStartData);
- ASSERT_EQ("DATE-TIME", TestJournal.DateTimeStartDataValue);
- ASSERT_EQ("Europe/Truro", TestJournal.DateTimeStartDataTimeZoneID);
- ASSERT_EQ("PARAMONE=YES;PARAMTWO=NO", TestJournal.DateTimeStartDataTokens);
+ ASSERT_EQ("20160131T143500Z", testJournal.dateTimeStartData);
+ ASSERT_EQ("DATE-TIME", testJournal.dateTimeStartDataValue);
+ ASSERT_EQ("Europe/Truro", testJournal.dateTimeStartDataTimeZoneID);
+ ASSERT_EQ("PARAMONE=YES;PARAMTWO=NO", testJournal.dateTimeStartDataTokens);
// Tests for LAST-MODIFIED.
- ASSERT_EQ("20160131T143700Z", TestJournal.LastModifiedData);
- ASSERT_EQ("FUTURE=YES", TestJournal.LastModifiedTokens);
+ ASSERT_EQ("20160131T143700Z", testJournal.lastModifiedData);
+ ASSERT_EQ("FUTURE=YES", testJournal.lastModifiedTokens);
// Tests for ORGANIZER.
- ASSERT_EQ("mailto:organiser@example.com", TestJournal.OrganiserData);
- ASSERT_EQ("ExampleOrganiser", TestJournal.OrganiserDataCommonName);
- ASSERT_EQ("null:nodata", TestJournal.OrganiserDataDirectoryEntry);
- ASSERT_EQ("mailto:organiser.noreply@example.com", TestJournal.OrganiserDataSentByParam);
- ASSERT_EQ("kw", TestJournal.OrganiserDataLanguage);
- ASSERT_EQ("HAPPY=DAYS", TestJournal.OrganiserDataTokens);
+ ASSERT_EQ("mailto:organiser@example.com", testJournal.organiserData);
+ ASSERT_EQ("ExampleOrganiser", testJournal.organiserDataCommonName);
+ ASSERT_EQ("null:nodata", testJournal.organiserDataDirectoryEntry);
+ ASSERT_EQ("mailto:organiser.noreply@example.com", testJournal.organiserDataSentByParam);
+ ASSERT_EQ("kw", testJournal.organiserDataLanguage);
+ ASSERT_EQ("HAPPY=DAYS", testJournal.organiserDataTokens);
// Tests for RECURRENCE-ID.
- ASSERT_EQ("20160131", TestJournal.RecurranceIDData);
- ASSERT_EQ("Europe/Truro", TestJournal.RecurranceIDDataTimeZoneParam);
- ASSERT_EQ("THISANDFUTURE", TestJournal.RecurranceIDDataRangeParam);
- ASSERT_EQ("DATE", TestJournal.RecurranceIDDataValue);
- ASSERT_EQ("EXAMPLE=DATA", TestJournal.RecurranceIDDataTokens);
+ ASSERT_EQ("20160131", testJournal.recurranceIDData);
+ ASSERT_EQ("Europe/Truro", testJournal.recurranceIDDataTimeZoneParam);
+ ASSERT_EQ("THISANDFUTURE", testJournal.recurranceIDDataRangeParam);
+ ASSERT_EQ("DATE", testJournal.recurranceIDDataValue);
+ ASSERT_EQ("EXAMPLE=DATA", testJournal.recurranceIDDataTokens);
// Tests for SEQUENCE.
- ASSERT_EQ(7, TestJournal.SequenceData);
- ASSERT_EQ("TEST=YAY", TestJournal.SequenceTokens);
+ ASSERT_EQ(7, testJournal.sequenceData);
+ ASSERT_EQ("TEST=YAY", testJournal.sequenceTokens);
// Tests for STATUS.
- ASSERT_EQ("2.0;Success", TestJournal.StatusData);
- ASSERT_EQ("kw", TestJournal.StatusLanguage);
- ASSERT_EQ("FAVOURITE=RICHTEA;NOTLIKE=UNKNOWN", TestJournal.StatusTokens);
+ ASSERT_EQ("2.0;Success", testJournal.statusData);
+ ASSERT_EQ("kw", testJournal.statusLanguage);
+ ASSERT_EQ("FAVOURITE=RICHTEA;NOTLIKE=UNKNOWN", testJournal.statusTokens);
// Tests for SUMMARY.
- ASSERT_EQ("A summary of the journal entry.", TestJournal.SummaryData);
- ASSERT_EQ("null:nodata", TestJournal.SummaryDataAltRep);
- ASSERT_EQ("kw", TestJournal.SummaryDataLanguage);
- ASSERT_EQ("FAVOURITE=TOFU;NOTLIKE=NONE", TestJournal.SummaryDataTokens);
+ ASSERT_EQ("A summary of the journal entry.", testJournal.summaryData);
+ ASSERT_EQ("null:nodata", testJournal.summaryDataAltRep);
+ ASSERT_EQ("kw", testJournal.summaryDataLanguage);
+ ASSERT_EQ("FAVOURITE=TOFU;NOTLIKE=NONE", testJournal.summaryDataTokens);
// Tests for URL.
- ASSERT_EQ("http://www.example.com/", TestJournal.URLData);
- ASSERT_EQ("EXTERNAL=YES", TestJournal.URLDataTokens);
+ ASSERT_EQ("http://www.example.com/", testJournal.urlData);
+ ASSERT_EQ("EXTERNAL=YES", testJournal.urlDataTokens);
// Tests for RRULE.
- ASSERT_EQ("FREQ=DAILY;COUNT=10", TestJournal.RecurranceRuleData);
- ASSERT_EQ("TEST=DATA", TestJournal.RecurranceRuleDataTokens);
+ ASSERT_EQ("FREQ=DAILY;COUNT=10", testJournal.recurranceRuleData);
+ ASSERT_EQ("TEST=DATA", testJournal.recurranceRuleDataTokens);
// Tests for ATTACH. First ATTACH property.
- std::string AttachData;
- std::string AttachDataFormatType;
- std::string AttachDataValue;
- std::string AttachDataEncoding;
- std::string AttachDataTokens;
+ std::string attachData;
+ std::string attachDataFormatType;
+ std::string attachDataValue;
+ std::string attachDataEncoding;
+ std::string attachDataTokens;
- if (TestJournal.AttachList.begin() != TestJournal.AttachList.end()){
+ if (testJournal.attachList.begin() != testJournal.attachList.end()){
- AttachData = TestJournal.AttachList[0];
+ attachData = testJournal.attachList[0];
}
- if (TestJournal.AttachListFormatType.begin() != TestJournal.AttachListFormatType.end()){
+ if (testJournal.attachListFormatType.begin() != testJournal.attachListFormatType.end()){
- AttachDataFormatType = TestJournal.AttachListFormatType[0];
+ attachDataFormatType = testJournal.attachListFormatType[0];
}
- ASSERT_EQ("http://www.example.com/", AttachData);
- ASSERT_EQ("application/internet-shortcut", AttachDataFormatType);
+ ASSERT_EQ("http://www.example.com/", attachData);
+ ASSERT_EQ("application/internet-shortcut", attachDataFormatType);
// Second ATTACH property.
- AttachData.clear();
- AttachDataFormatType.clear();
- AttachDataValue.clear();
- AttachDataEncoding.clear();
+ attachData.clear();
+ attachDataFormatType.clear();
+ attachDataValue.clear();
+ attachDataEncoding.clear();
- if (TestJournal.AttachList.size() > 1){
+ if (testJournal.attachList.size() > 1){
- AttachData = TestJournal.AttachList[1];
+ attachData = testJournal.attachList[1];
}
- if (TestJournal.AttachListFormatType.size() > 1){
+ if (testJournal.attachListFormatType.size() > 1){
- AttachDataFormatType = TestJournal.AttachListFormatType[1];
+ attachDataFormatType = testJournal.attachListFormatType[1];
}
- ASSERT_EQ("http://www.example.com/page2.html", AttachData);
- ASSERT_EQ("application/internet-shortcut", AttachDataFormatType);
+ ASSERT_EQ("http://www.example.com/page2.html", attachData);
+ ASSERT_EQ("application/internet-shortcut", attachDataFormatType);
// Third ATTACH property.
- AttachData.clear();
- AttachDataFormatType.clear();
- AttachDataValue.clear();
- AttachDataEncoding.clear();
- AttachDataTokens.clear();
+ attachData.clear();
+ attachDataFormatType.clear();
+ attachDataValue.clear();
+ attachDataEncoding.clear();
+ attachDataTokens.clear();
- if (TestJournal.AttachList.size() > 2){
+ if (testJournal.attachList.size() > 2){
- AttachData = TestJournal.AttachList[2];
+ attachData = testJournal.attachList[2];
}
- if (TestJournal.AttachListFormatType.size() > 2){
+ if (testJournal.attachListFormatType.size() > 2){
- AttachDataFormatType = TestJournal.AttachListFormatType[2];
+ attachDataFormatType = testJournal.attachListFormatType[2];
}
- if (TestJournal.AttachListValue.size() > 2){
+ if (testJournal.attachListValue.size() > 2){
- AttachDataValue = TestJournal.AttachListValue[2];
+ attachDataValue = testJournal.attachListValue[2];
}
- if (TestJournal.AttachListFormatType.size() > 2){
+ if (testJournal.attachListFormatType.size() > 2){
- AttachDataEncoding = TestJournal.AttachListEncoding[2];
+ attachDataEncoding = testJournal.attachListEncoding[2];
}
- if (TestJournal.AttachListTokens.size() > 2){
+ if (testJournal.attachListTokens.size() > 2){
- AttachDataTokens = TestJournal.AttachListTokens[2];
+ attachDataTokens = testJournal.attachListTokens[2];
}
- ASSERT_EQ("VGhpcyBpcyBhbiBleGFtcGxlIGZpbGU=", AttachData);
- ASSERT_EQ("text/plain", AttachDataFormatType);
- ASSERT_EQ("BASE64", AttachDataEncoding);
- ASSERT_EQ("BINARY", AttachDataValue);
- ASSERT_EQ("STUPID=EXAMPLE", AttachDataTokens);
+ ASSERT_EQ("VGhpcyBpcyBhbiBleGFtcGxlIGZpbGU=", attachData);
+ ASSERT_EQ("text/plain", attachDataFormatType);
+ ASSERT_EQ("BASE64", attachDataEncoding);
+ ASSERT_EQ("BINARY", attachDataValue);
+ ASSERT_EQ("STUPID=EXAMPLE", attachDataTokens);
// Tests for ATTENDEE. First ATTENDEE property.
- std::string AttendeeDataMember;
- std::string AttendeeDataDelegatedFrom;
- std::string AttendeeDataDelegatedTo;
- std::string AttendeeDataRole;
- std::string AttendeeDataRSVP;
- std::string AttendeeDataDirectoryEntry;
- std::string AttendeeDataSentBy;
- std::string AttendeeDataCommonName;
- std::string AttendeeDataCalendarUserType;
- std::string AttendeeDataParticipationStatus;
- std::string AttendeeDataLanguage;
- std::string AttendeeDataTokens;
- std::string AttendeeData;
+ std::string attendeeDataMember;
+ std::string attendeeDataDelegatedFrom;
+ std::string attendeeDataDelegatedTo;
+ std::string attendeeDataRole;
+ std::string attendeeDataRSVP;
+ std::string attendeeDataDirectoryEntry;
+ std::string attendeeDataSentBy;
+ std::string attendeeDataCommonName;
+ std::string attendeeDataCalendarUserType;
+ std::string attendeeDataParticipationStatus;
+ std::string attendeeDataLanguage;
+ std::string attendeeDataTokens;
+ std::string attendeeData;
- if (TestJournal.AttendeeList.begin() != TestJournal.AttendeeList.end()){
+ if (testJournal.attendeeList.begin() != testJournal.attendeeList.end()){
- AttendeeData = TestJournal.AttendeeList[0];
+ attendeeData = testJournal.attendeeList[0];
}
- ASSERT_EQ("Attendee One", AttendeeData);
+ ASSERT_EQ("Attendee One", attendeeData);
// Second ATTENDEE property.
- AttendeeData.clear();
+ attendeeData.clear();
- if (TestJournal.AttendeeList.size() > 1){
+ if (testJournal.attendeeList.size() > 1){
- AttendeeData = TestJournal.AttendeeList[1];
+ attendeeData = testJournal.attendeeList[1];
}
- if (TestJournal.AttendeeList.size() > 1){
+ if (testJournal.attendeeList.size() > 1){
- AttendeeDataDelegatedFrom = TestJournal.AttendeeListDelegatedFrom[1];
+ attendeeDataDelegatedFrom = testJournal.attendeeListDelegatedFrom[1];
}
- if (TestJournal.AttendeeList.size() > 1){
+ if (testJournal.attendeeList.size() > 1){
- AttendeeDataDelegatedTo = TestJournal.AttendeeListDelegatedTo[1];
+ attendeeDataDelegatedTo = testJournal.attendeeListDelegatedTo[1];
}
- if (TestJournal.AttendeeList.size() > 1){
+ if (testJournal.attendeeList.size() > 1){
- AttendeeDataRole = TestJournal.AttendeeListRole[1];
+ attendeeDataRole = testJournal.attendeeListRole[1];
}
- if (TestJournal.AttendeeList.size() > 1){
+ if (testJournal.attendeeList.size() > 1){
- AttendeeDataRSVP = TestJournal.AttendeeListRSVP[1];
+ attendeeDataRSVP = testJournal.attendeeListRSVP[1];
}
- ASSERT_EQ("Attendee Two", AttendeeData);
- ASSERT_EQ("mailto:delegated.from@example.com", AttendeeDataDelegatedFrom);
- ASSERT_EQ("mailto:delegated.to@example.com", AttendeeDataDelegatedTo);
- ASSERT_EQ("CHAIR", AttendeeDataRole);
- ASSERT_EQ("TRUE", AttendeeDataRSVP);
+ ASSERT_EQ("Attendee Two", attendeeData);
+ ASSERT_EQ("mailto:delegated.from@example.com", attendeeDataDelegatedFrom);
+ ASSERT_EQ("mailto:delegated.to@example.com", attendeeDataDelegatedTo);
+ ASSERT_EQ("CHAIR", attendeeDataRole);
+ ASSERT_EQ("TRUE", attendeeDataRSVP);
// Third ATTENDEE property.
- AttendeeData.clear();
+ attendeeData.clear();
- if (TestJournal.AttendeeList.size() > 2){
+ if (testJournal.attendeeList.size() > 2){
- AttendeeData = TestJournal.AttendeeList[2];
+ attendeeData = testJournal.attendeeList[2];
}
- if (TestJournal.AttendeeList.size() > 2){
+ if (testJournal.attendeeList.size() > 2){
- AttendeeDataDirectoryEntry = TestJournal.AttendeeListDirectoryEntry[2];
+ attendeeDataDirectoryEntry = testJournal.attendeeListDirectoryEntry[2];
}
- if (TestJournal.AttendeeList.size() > 2){
+ if (testJournal.attendeeList.size() > 2){
- AttendeeDataSentBy = TestJournal.AttendeeListSentBy[2];
+ attendeeDataSentBy = testJournal.attendeeListSentBy[2];
}
- if (TestJournal.AttendeeList.size() > 2){
+ if (testJournal.attendeeList.size() > 2){
- AttendeeDataCommonName = TestJournal.AttendeeListCommonName[2];
+ attendeeDataCommonName = testJournal.attendeeListCommonName[2];
}
- if (TestJournal.AttendeeList.size() > 2){
+ if (testJournal.attendeeList.size() > 2){
- AttendeeDataCalendarUserType = TestJournal.AttendeeListCalendarUserType[2];
+ attendeeDataCalendarUserType = testJournal.attendeeListCalendarUserType[2];
}
- if (TestJournal.AttendeeList.size() > 2){
+ if (testJournal.attendeeList.size() > 2){
- AttendeeDataParticipationStatus = TestJournal.AttendeeListParticipationStatus[2];
+ attendeeDataParticipationStatus = testJournal.attendeeListParticipationStatus[2];
}
- if (TestJournal.AttendeeList.size() > 2){
+ if (testJournal.attendeeList.size() > 2){
- AttendeeDataLanguage = TestJournal.AttendeeListLanguage[2];
+ attendeeDataLanguage = testJournal.attendeeListLanguage[2];
}
- if (TestJournal.AttendeeList.size() > 2){
+ if (testJournal.attendeeList.size() > 2){
- AttendeeDataTokens = TestJournal.AttendeeListTokens[2];
+ attendeeDataTokens = testJournal.attendeeListTokens[2];
}
- ASSERT_EQ("Attendee Three", AttendeeData);
- ASSERT_EQ("null:nodata", AttendeeDataDirectoryEntry);
- ASSERT_EQ("mailto:sent.by@example.com", AttendeeDataSentBy);
- ASSERT_EQ("Attendee The Third", AttendeeDataCommonName);
- ASSERT_EQ("INDIVIDUAL", AttendeeDataCalendarUserType);
- ASSERT_EQ("ACCEPTED", AttendeeDataParticipationStatus);
- ASSERT_EQ("kw", AttendeeDataLanguage);
- ASSERT_EQ("EXAMPLE=DATA", AttendeeDataTokens);
+ ASSERT_EQ("Attendee Three", attendeeData);
+ ASSERT_EQ("null:nodata", attendeeDataDirectoryEntry);
+ ASSERT_EQ("mailto:sent.by@example.com", attendeeDataSentBy);
+ ASSERT_EQ("Attendee The Third", attendeeDataCommonName);
+ ASSERT_EQ("INDIVIDUAL", attendeeDataCalendarUserType);
+ ASSERT_EQ("ACCEPTED", attendeeDataParticipationStatus);
+ ASSERT_EQ("kw", attendeeDataLanguage);
+ ASSERT_EQ("EXAMPLE=DATA", attendeeDataTokens);
// Get the first CATEGORIES.
- std::string CategoryData;
+ std::string categoryData;
- if (TestJournal.CategoriesList.begin() != TestJournal.CategoriesList.end()){
+ if (testJournal.categoriesList.begin() != testJournal.categoriesList.end()){
- CategoryData = TestJournal.CategoriesList[0];
+ categoryData = testJournal.categoriesList[0];
}
- ASSERT_EQ("CATEGORY ONE, CATEGORY TWO", CategoryData);
+ ASSERT_EQ("CATEGORY ONE, CATEGORY TWO", categoryData);
- CategoryData.clear();
+ categoryData.clear();
- std::string CategoryLanguage;
+ std::string categoryLanguage;
// Get the second CATEGORIES.
- if (TestJournal.CategoriesList.size() > 1){
+ if (testJournal.categoriesList.size() > 1){
- CategoryData = TestJournal.CategoriesList[1];
+ categoryData = testJournal.categoriesList[1];
}
- if (TestJournal.CategoriesList.size() > 1){
+ if (testJournal.categoriesList.size() > 1){
- CategoryLanguage = TestJournal.CategoriesListLanguage[1];
+ categoryLanguage = testJournal.categoriesListLanguage[1];
}
- ASSERT_EQ("CATEGORY THREE, CATEGORY FOUR", CategoryData);
- ASSERT_EQ("en", CategoryLanguage);
+ ASSERT_EQ("CATEGORY THREE, CATEGORY FOUR", categoryData);
+ ASSERT_EQ("en", categoryLanguage);
- CategoryData.clear();
- CategoryLanguage.clear();
+ categoryData.clear();
+ categoryLanguage.clear();
// Get the third CATEGORIES.
- std::string CategoryTokens;
+ std::string categoryTokens;
- if (TestJournal.CategoriesList.size() > 2){
+ if (testJournal.categoriesList.size() > 2){
- CategoryData = TestJournal.CategoriesList[2];
+ categoryData = testJournal.categoriesList[2];
}
- if (TestJournal.CategoriesList.size() > 2){
+ if (testJournal.categoriesList.size() > 2){
- CategoryLanguage = TestJournal.CategoriesListLanguage[2];
+ categoryLanguage = testJournal.categoriesListLanguage[2];
}
- if (TestJournal.CategoriesList.size() > 2){
+ if (testJournal.categoriesList.size() > 2){
- CategoryTokens = TestJournal.CategoriesListTokens[2];
+ categoryTokens = testJournal.categoriesListTokens[2];
}
- ASSERT_EQ("CATEGORY FIVE, CATEGORY SIX, CATEGORY SEVEN", CategoryData);
- ASSERT_EQ("en-GB", CategoryLanguage);
- ASSERT_EQ("SAMPLE=TOKEN", CategoryTokens);
+ ASSERT_EQ("CATEGORY FIVE, CATEGORY SIX, CATEGORY SEVEN", categoryData);
+ ASSERT_EQ("en-GB", categoryLanguage);
+ ASSERT_EQ("SAMPLE=TOKEN", categoryTokens);
// Get the first COMMENT.
- std::string CommentData;
+ std::string commentData;
- if (TestJournal.CommentList.begin() != TestJournal.CommentList.end()){
+ if (testJournal.commentList.begin() != testJournal.commentList.end()){
- CommentData = TestJournal.CommentList[0];
+ commentData = testJournal.commentList[0];
}
- ASSERT_EQ("This is the first comment.", CommentData);
+ ASSERT_EQ("This is the first comment.", commentData);
// Get the second COMMENT.
- CommentData.clear();
+ commentData.clear();
- std::string CommentDataAltRep;
- std::string CommentDataLanguage;
+ std::string commentDataAltRep;
+ std::string commentDataLanguage;
- if (TestJournal.CommentList.size() > 1){
+ if (testJournal.commentList.size() > 1){
- CommentData = TestJournal.CommentList[1];
+ commentData = testJournal.commentList[1];
}
- if (TestJournal.CommentList.size() > 1){
+ if (testJournal.commentList.size() > 1){
- CommentDataAltRep = TestJournal.CommentListAltRep[1];
+ commentDataAltRep = testJournal.commentListAltRep[1];
}
- if (TestJournal.CommentList.size() > 1){
+ if (testJournal.commentList.size() > 1){
- CommentDataLanguage = TestJournal.CommentListLanguage[1];
+ commentDataLanguage = testJournal.commentListLanguage[1];
}
- ASSERT_EQ("This is the second comment.", CommentData);
- ASSERT_EQ("null:nodata", CommentDataAltRep);
- ASSERT_EQ("en", CommentDataLanguage);
+ ASSERT_EQ("This is the second comment.", commentData);
+ ASSERT_EQ("null:nodata", commentDataAltRep);
+ ASSERT_EQ("en", commentDataLanguage);
// Get the third COMMENT.
- CommentData.clear();
+ commentData.clear();
- std::string CommentDataTokens;
+ std::string commentDataTokens;
- if (TestJournal.CommentList.size() > 2){
+ if (testJournal.commentList.size() > 2){
- CommentData = TestJournal.CommentList[2];
+ commentData = testJournal.commentList[2];
}
- if (TestJournal.CommentList.size() > 2){
+ if (testJournal.commentList.size() > 2){
- CommentDataTokens = TestJournal.CommentListTokens[2];
+ commentDataTokens = testJournal.commentListTokens[2];
}
- ASSERT_EQ("This is the third comment.", CommentData);
- ASSERT_EQ("ZEBRAS=YES", CommentDataTokens);
+ ASSERT_EQ("This is the third comment.", commentData);
+ ASSERT_EQ("ZEBRAS=YES", commentDataTokens);
// Get the first CONTACT.
- std::string ContactData;
+ std::string contactData;
- if (TestJournal.ContactList.begin() != TestJournal.ContactList.end()){
+ if (testJournal.contactList.begin() != testJournal.contactList.end()){
- ContactData = TestJournal.ContactList[0];
+ contactData = testJournal.contactList[0];
}
- ASSERT_EQ("First Contact", ContactData);
+ ASSERT_EQ("First Contact", contactData);
// Get the second CONTACT.
- ContactData.clear();
+ contactData.clear();
- std::string ContactDataAltRep;
- std::string ContactDataLanguage;
+ std::string contactDataAltRep;
+ std::string contactDataLanguage;
- if (TestJournal.ContactList.size() > 1){
+ if (testJournal.contactList.size() > 1){
- ContactData = TestJournal.ContactList[1];
+ contactData = testJournal.contactList[1];
}
- if (TestJournal.ContactList.size() > 1){
+ if (testJournal.contactList.size() > 1){
- ContactDataAltRep = TestJournal.ContactListAltRep[1];
+ contactDataAltRep = testJournal.contactListAltRep[1];
}
- if (TestJournal.ContactList.size() > 1){
+ if (testJournal.contactList.size() > 1){
- ContactDataLanguage = TestJournal.ContactListLanguage[1];
+ contactDataLanguage = testJournal.contactListLanguage[1];
}
- ASSERT_EQ("Second Contact", ContactData);
- ASSERT_EQ("null:nodata", ContactDataAltRep);
- ASSERT_EQ("en-GB", ContactDataLanguage);
+ ASSERT_EQ("Second Contact", contactData);
+ ASSERT_EQ("null:nodata", contactDataAltRep);
+ ASSERT_EQ("en-GB", contactDataLanguage);
// Get the third CONTACT.
- ContactData.clear();
+ contactData.clear();
- std::string ContactDataTokens;
+ std::string contactDataTokens;
- if (TestJournal.ContactList.size() > 2){
+ if (testJournal.contactList.size() > 2){
- ContactData = TestJournal.ContactList[2];
+ contactData = testJournal.contactList[2];
}
- if (TestJournal.ContactList.size() > 2){
+ if (testJournal.contactList.size() > 2){
- ContactDataTokens = TestJournal.ContactListTokens[2];
+ contactDataTokens = testJournal.contactListTokens[2];
}
- ASSERT_EQ("Third Contact", ContactData);
- ASSERT_EQ("ZEBRAS=NO", ContactDataTokens);
+ ASSERT_EQ("Third Contact", contactData);
+ ASSERT_EQ("ZEBRAS=NO", contactDataTokens);
// Get the first DESCRIPTION.
- std::string DescriptionData;
+ std::string descriptionData;
- if (TestJournal.DescriptionList.begin() != TestJournal.DescriptionList.end()){
+ if (testJournal.descriptionList.begin() != testJournal.descriptionList.end()){
- DescriptionData = TestJournal.DescriptionList[0];
+ descriptionData = testJournal.descriptionList[0];
}
- ASSERT_EQ("First Journal Entry Description", DescriptionData);
+ ASSERT_EQ("First Journal Entry Description", descriptionData);
// Get the second DESCRIPTION.
- DescriptionData.clear();
+ descriptionData.clear();
- std::string DescriptionAltRep;
- std::string DescriptionLanguage;
+ std::string descriptionAltRep;
+ std::string descriptionLanguage;
- if (TestJournal.DescriptionList.size() > 1){
+ if (testJournal.descriptionList.size() > 1){
- DescriptionData = TestJournal.DescriptionList[1];
+ descriptionData = testJournal.descriptionList[1];
}
- if (TestJournal.DescriptionList.size() > 1){
+ if (testJournal.descriptionList.size() > 1){
- DescriptionAltRep = TestJournal.DescriptionListAltRep[1];
+ descriptionAltRep = testJournal.descriptionListAltRep[1];
}
- if (TestJournal.DescriptionList.size() > 1){
+ if (testJournal.descriptionList.size() > 1){
- DescriptionLanguage = TestJournal.DescriptionListLanguage[1];
+ descriptionLanguage = testJournal.descriptionListLanguage[1];
}
- ASSERT_EQ("This is the second journal description.", DescriptionData);
- ASSERT_EQ("null:nodata", DescriptionAltRep);
- ASSERT_EQ("en-GB", DescriptionLanguage);
+ ASSERT_EQ("This is the second journal description.", descriptionData);
+ ASSERT_EQ("null:nodata", descriptionAltRep);
+ ASSERT_EQ("en-GB", descriptionLanguage);
// Get the third DESCRIPTION.
- DescriptionData.clear();
+ descriptionData.clear();
- std::string DescriptionDataTokens;
+ std::string descriptionDataTokens;
- if (TestJournal.DescriptionList.size() > 2){
+ if (testJournal.descriptionList.size() > 2){
- DescriptionData = TestJournal.DescriptionList[2];
+ descriptionData = testJournal.descriptionList[2];
}
- if (TestJournal.DescriptionList.size() > 2){
+ if (testJournal.descriptionList.size() > 2){
- DescriptionDataTokens = TestJournal.DescriptionListTokens[2];
+ descriptionDataTokens = testJournal.descriptionListTokens[2];
}
- ASSERT_EQ("This is the third journal description.", DescriptionData);
- ASSERT_EQ("ZEBRAS=NO", DescriptionDataTokens);
+ ASSERT_EQ("This is the third journal description.", descriptionData);
+ ASSERT_EQ("ZEBRAS=NO", descriptionDataTokens);
// Get the first EXDATE.
- std::string ExcludeDate;
+ std::string excludeDate;
- if (TestJournal.ExcludeDateData.begin() != TestJournal.ExcludeDateData.end()){
+ if (testJournal.excludeDateData.begin() != testJournal.excludeDateData.end()){
- ExcludeDate = TestJournal.ExcludeDateData[0];
+ excludeDate = testJournal.excludeDateData[0];
}
- ASSERT_EQ("20160125T120000Z", ExcludeDate);
+ ASSERT_EQ("20160125T120000Z", excludeDate);
// Get the second EXDATE.
- ExcludeDate.clear();
+ excludeDate.clear();
- std::string ExcludeDataTimeZoneParam;
- std::string ExcludeDataValue;
+ std::string excludeDataTimeZoneParam;
+ std::string excludeDataValue;
- if (TestJournal.ContactList.size() > 1){
+ if (testJournal.contactList.size() > 1){
- ExcludeDate = TestJournal.ExcludeDateData[1];
+ excludeDate = testJournal.excludeDateData[1];
}
- if (TestJournal.ContactList.size() > 1){
+ if (testJournal.contactList.size() > 1){
- ExcludeDataTimeZoneParam = TestJournal.ExcludeDateDataTimeZoneParam[1];
+ excludeDataTimeZoneParam = testJournal.excludeDateDataTimeZoneParam[1];
}
- if (TestJournal.ContactList.size() > 1){
+ if (testJournal.contactList.size() > 1){
- ExcludeDataValue = TestJournal.ExcludeDateDataValue[1];
+ excludeDataValue = testJournal.excludeDateDataValue[1];
}
- ASSERT_EQ("20160125T130000Z", ExcludeDate);
- ASSERT_EQ("DATE-TIME", ExcludeDataValue);
- ASSERT_EQ("Europe/Truro", ExcludeDataTimeZoneParam);
+ ASSERT_EQ("20160125T130000Z", excludeDate);
+ ASSERT_EQ("DATE-TIME", excludeDataValue);
+ ASSERT_EQ("Europe/Truro", excludeDataTimeZoneParam);
// Get the third EXDATE.
- ExcludeDate.clear();
+ excludeDate.clear();
- std::string ExcludeDataTokens;
+ std::string excludeDataTokens;
- if (TestJournal.ContactList.size() > 2){
+ if (testJournal.contactList.size() > 2){
- ExcludeDate = TestJournal.ExcludeDateData[2];
+ excludeDate = testJournal.excludeDateData[2];
}
- if (TestJournal.ContactList.size() > 2){
+ if (testJournal.contactList.size() > 2){
- ExcludeDataTokens = TestJournal.ExcludeDateDataTokens[2];
+ excludeDataTokens = testJournal.excludeDateDataTokens[2];
}
- ASSERT_EQ("20160125T133000Z", ExcludeDate);
- ASSERT_EQ("ZOOP=ZIPPO", ExcludeDataTokens);
+ ASSERT_EQ("20160125T133000Z", excludeDate);
+ ASSERT_EQ("ZOOP=ZIPPO", excludeDataTokens);
// Get the first RELATED-TO.
- std::string RelatedTo;
+ std::string relatedTo;
- if (TestJournal.RelatedToData.begin() != TestJournal.RelatedToData.end()){
+ if (testJournal.relatedToData.begin() != testJournal.relatedToData.end()){
- RelatedTo = TestJournal.RelatedToData[0];
+ relatedTo = testJournal.relatedToData[0];
}
- ASSERT_EQ("person.1@example.com", RelatedTo);
+ ASSERT_EQ("person.1@example.com", relatedTo);
// Get the second RELATED-TO.
- RelatedTo.clear();
+ relatedTo.clear();
- std::string RelatedToType;
+ std::string relatedToType;
- if (TestJournal.RelatedToData.size() > 1){
+ if (testJournal.relatedToData.size() > 1){
- RelatedTo = TestJournal.RelatedToData[1];
+ relatedTo = testJournal.relatedToData[1];
}
- if (TestJournal.RelatedToData.size() > 1){
+ if (testJournal.relatedToData.size() > 1){
- RelatedToType = TestJournal.RelatedToDataRelationType[1];
+ relatedToType = testJournal.relatedToDataRelationType[1];
}
- ASSERT_EQ("person.2@example.com", RelatedTo);
- ASSERT_EQ("PARENT", RelatedToType);
+ ASSERT_EQ("person.2@example.com", relatedTo);
+ ASSERT_EQ("PARENT", relatedToType);
// Get the third RELATED-TO.
- RelatedTo.clear();
+ relatedTo.clear();
- std::string RelatedToTokens;
+ std::string relatedToTokens;
- if (TestJournal.RelatedToData.size() > 2){
+ if (testJournal.relatedToData.size() > 2){
- RelatedTo = TestJournal.RelatedToData[2];
+ relatedTo = testJournal.relatedToData[2];
}
- if (TestJournal.RelatedToData.size() > 2){
+ if (testJournal.relatedToData.size() > 2){
- RelatedToTokens = TestJournal.RelatedToDataTokens[2];
+ relatedToTokens = testJournal.relatedToDataTokens[2];
}
- ASSERT_EQ("person.3@example.com", RelatedTo);
- ASSERT_EQ("SCHOOL=MEETING", RelatedToTokens);
+ ASSERT_EQ("person.3@example.com", relatedTo);
+ ASSERT_EQ("SCHOOL=MEETING", relatedToTokens);
// Get the first RDATE.
- std::string RecurrenceDate;
+ std::string recurrenceDate;
- if (TestJournal.RecurranceDateData.begin() != TestJournal.RecurranceDateData.end()){
+ if (testJournal.RecurranceDateData.begin() != testJournal.RecurranceDateData.end()){
- RecurrenceDate = TestJournal.RecurranceDateData[0];
+ recurrenceDate = testJournal.RecurranceDateData[0];
}
- ASSERT_EQ("20160120", RecurrenceDate);
+ ASSERT_EQ("20160120", recurrenceDate);
// Get the second RDATE.
- RecurrenceDate.clear();
+ recurrenceDate.clear();
- std::string RecurrenceDateTimeZoneParam;
- std::string RecurrenceDateValue;
+ std::string recurrenceDateTimeZoneParam;
+ std::string recurrenceDateValue;
- if (TestJournal.RecurranceDateData.size() > 1){
+ if (testJournal.RecurranceDateData.size() > 1){
- RecurrenceDate = TestJournal.RecurranceDateData[1];
+ recurrenceDate = testJournal.RecurranceDateData[1];
}
- if (TestJournal.RecurranceDateData.size() > 1){
+ if (testJournal.RecurranceDateData.size() > 1){
- RecurrenceDateTimeZoneParam = TestJournal.RecurranceDateDataTimeZoneParam[1];
+ recurrenceDateTimeZoneParam = testJournal.RecurranceDateDataTimeZoneParam[1];
}
- if (TestJournal.RecurranceDateData.size() > 1){
+ if (testJournal.RecurranceDateData.size() > 1){
- RecurrenceDateValue = TestJournal.RecurranceDateDataValue[1];
+ recurrenceDateValue = testJournal.RecurranceDateDataValue[1];
}
- ASSERT_EQ("20160121", RecurrenceDate);
- ASSERT_EQ("DATE", RecurrenceDateValue);
- ASSERT_EQ("Europe/Truro", RecurrenceDateTimeZoneParam);
+ ASSERT_EQ("20160121", recurrenceDate);
+ ASSERT_EQ("DATE", recurrenceDateValue);
+ ASSERT_EQ("Europe/Truro", recurrenceDateTimeZoneParam);
// Get the third RDATE.
- RecurrenceDate.clear();
+ recurrenceDate.clear();
std::string RecurrenceTokens;
- if (TestJournal.RecurranceDateData.size() > 2){
+ if (testJournal.RecurranceDateData.size() > 2){
- RecurrenceDate = TestJournal.RecurranceDateData[2];
+ recurrenceDate = testJournal.RecurranceDateData[2];
}
- if (TestJournal.RecurranceDateData.size() > 2){
+ if (testJournal.RecurranceDateData.size() > 2){
- RecurrenceTokens = TestJournal.RecurranceDateDataTokens[2];
+ RecurrenceTokens = testJournal.RecurranceDateDataTokens[2];
}
- ASSERT_EQ("20160520", RecurrenceDate);
+ ASSERT_EQ("20160520", recurrenceDate);
ASSERT_EQ("ZILCH=DATA", RecurrenceTokens);
// Get the first REQUEST-STATUS.
- std::string RequestStatus;
+ std::string requestStatus;
- if (TestJournal.RequestStatusData.begin() != TestJournal.RequestStatusData.end()){
+ if (testJournal.requestStatusData.begin() != testJournal.requestStatusData.end()){
- RequestStatus = TestJournal.RequestStatusData[0];
+ requestStatus = testJournal.requestStatusData[0];
}
- ASSERT_EQ("2.0;Success", RequestStatus);
+ ASSERT_EQ("2.0;Success", requestStatus);
// Get the second REQUEST-STATUS.
- RequestStatus.clear();
+ requestStatus.clear();
- std::string RequestLanguage;
+ std::string requestLanguage;
- if (TestJournal.ContactList.size() > 1){
+ if (testJournal.contactList.size() > 1){
- RequestStatus = TestJournal.RequestStatusData[1];
+ requestStatus = testJournal.requestStatusData[1];
}
- if (TestJournal.ContactList.size() > 1){
+ if (testJournal.contactList.size() > 1){
- RequestLanguage = TestJournal.RequestStatusLanguage[1];
+ requestLanguage = testJournal.requestStatusLanguage[1];
}
- ASSERT_EQ("3.42;Really big irrecoverable error caused by the user", RequestStatus);
- ASSERT_EQ("en", RequestLanguage);
+ ASSERT_EQ("3.42;Really big irrecoverable error caused by the user", requestStatus);
+ ASSERT_EQ("en", requestLanguage);
// Get the third REQUEST-STATUS.
- RequestStatus.clear();
+ requestStatus.clear();
- std::string RequestTokens;
+ std::string requestTokens;
- if (TestJournal.ContactList.size() > 2){
+ if (testJournal.contactList.size() > 2){
- RequestStatus = TestJournal.RequestStatusData[2];
+ requestStatus = testJournal.requestStatusData[2];
}
- if (TestJournal.ContactList.size() > 2){
+ if (testJournal.contactList.size() > 2){
- RequestTokens = TestJournal.RequestStatusTokens[2];
+ requestTokens = testJournal.requestStatusTokens[2];
}
- ASSERT_EQ("3.7;Invalid calendar user", RequestStatus);
- ASSERT_EQ("USER=MISSING", RequestTokens);
+ ASSERT_EQ("3.7;Invalid calendar user", requestStatus);
+ ASSERT_EQ("USER=MISSING", requestTokens);
// Get the first X-EXAMPLE1 token.
- std::string XTokenName;
- std::string XTokenData;
+ std::string xTokenName;
+ std::string xTokenData;
- if (TestJournal.XTokensData.size() != 0 ){
+ if (testJournal.xTokensData.size() != 0 ){
- XTokenData = TestJournal.XTokensData[0];
+ xTokenData = testJournal.xTokensData[0];
}
- if (TestJournal.XTokensData.size() != 0){
+ if (testJournal.xTokensData.size() != 0){
- XTokenName = TestJournal.XTokensDataTokens[0];
+ xTokenName = testJournal.xTokensDataTokens[0];
}
- ASSERT_EQ("Moo", XTokenData);
- ASSERT_EQ("X-EXAMPLE1", XTokenName);
+ ASSERT_EQ("Moo", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1", xTokenName);
// Get the second X-EXAMPLE1 token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestJournal.XTokensData.size() > 1){
+ if (testJournal.xTokensData.size() > 1){
- XTokenData = TestJournal.XTokensData[1];
+ xTokenData = testJournal.xTokensData[1];
}
- if (TestJournal.XTokensData.size() > 1){
+ if (testJournal.xTokensData.size() > 1){
- XTokenName = TestJournal.XTokensDataTokens[1];
+ xTokenName = testJournal.xTokensDataTokens[1];
}
- ASSERT_EQ("Meep", XTokenData);
- ASSERT_EQ("X-EXAMPLE1;ANIMAL=NOPE", XTokenName);
+ ASSERT_EQ("Meep", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1;ANIMAL=NOPE", xTokenName);
// Get the third X-EXAMPLE1 token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestJournal.XTokensData.size() > 2){
+ if (testJournal.xTokensData.size() > 2){
- XTokenData = TestJournal.XTokensData[2];
+ xTokenData = testJournal.xTokensData[2];
}
- if (TestJournal.XTokensData.size() > 2){
+ if (testJournal.xTokensData.size() > 2){
- XTokenName = TestJournal.XTokensDataTokens[2];
+ xTokenName = testJournal.xTokensDataTokens[2];
}
- ASSERT_EQ("Meow", XTokenData);
- ASSERT_EQ("X-EXAMPLE1;ANIMAL=CAT", XTokenName);
+ ASSERT_EQ("Meow", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1;ANIMAL=CAT", xTokenName);
// Get the first X-EXAMPLE2 token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestJournal.XTokensData.size() > 3){
+ if (testJournal.xTokensData.size() > 3){
- XTokenData = TestJournal.XTokensData[3];
+ xTokenData = testJournal.xTokensData[3];
}
- if (TestJournal.XTokensData.size() > 3){
+ if (testJournal.xTokensData.size() > 3){
- XTokenName = TestJournal.XTokensDataTokens[3];
+ xTokenName = testJournal.xTokensDataTokens[3];
}
- ASSERT_EQ("Dish", XTokenData);
- ASSERT_EQ("X-EXAMPLE2", XTokenName);
+ ASSERT_EQ("Dish", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2", xTokenName);
// Get the second X-EXAMPLE2 token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestJournal.XTokensData.size() > 4){
+ if (testJournal.xTokensData.size() > 4){
- XTokenData = TestJournal.XTokensData[4];
+ xTokenData = testJournal.xTokensData[4];
}
- if (TestJournal.XTokensData.size() > 4){
+ if (testJournal.xTokensData.size() > 4){
- XTokenName = TestJournal.XTokensDataTokens[4];
+ xTokenName = testJournal.xTokensDataTokens[4];
}
- ASSERT_EQ("Fork", XTokenData);
- ASSERT_EQ("X-EXAMPLE2;OBJECT=KITCHEN", XTokenName);
+ ASSERT_EQ("Fork", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2;OBJECT=KITCHEN", xTokenName);
// Get the third X-EXAMPLE2 token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestJournal.XTokensData.size() > 5){
+ if (testJournal.xTokensData.size() > 5){
- XTokenData = TestJournal.XTokensData[5];
+ xTokenData = testJournal.xTokensData[5];
}
- if (TestJournal.XTokensData.size() > 5){
+ if (testJournal.xTokensData.size() > 5){
- XTokenName = TestJournal.XTokensDataTokens[5];
+ xTokenName = testJournal.xTokensDataTokens[5];
}
- ASSERT_EQ("Table", XTokenData);
- ASSERT_EQ("X-EXAMPLE2;OBJECT=LIVINGROOM", XTokenName);
+ ASSERT_EQ("Table", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2;OBJECT=LIVINGROOM", xTokenName);
// Get the X-STATUS token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestJournal.XTokensData.size() > 6){
+ if (testJournal.xTokensData.size() > 6){
- XTokenData = TestJournal.XTokensData[6];
+ xTokenData = testJournal.xTokensData[6];
}
- if (TestJournal.XTokensData.size() > 6){
+ if (testJournal.xTokensData.size() > 6){
- XTokenName = TestJournal.XTokensDataTokens[6];
+ xTokenName = testJournal.xTokensDataTokens[6];
}
- ASSERT_EQ("Idle", XTokenData);
- ASSERT_EQ("X-STATUS;HOLIDAY=YES", XTokenName);
+ ASSERT_EQ("Idle", xTokenData);
+ ASSERT_EQ("X-STATUS;HOLIDAY=YES", xTokenName);
// Get the X-TRANSPORT token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestJournal.XTokensData.size() > 7){
+ if (testJournal.xTokensData.size() > 7){
- XTokenData = TestJournal.XTokensData[7];
+ xTokenData = testJournal.xTokensData[7];
}
- if (TestJournal.XTokensData.size() > 7){
+ if (testJournal.xTokensData.size() > 7){
- XTokenName = TestJournal.XTokensDataTokens[7];
+ xTokenName = testJournal.xTokensDataTokens[7];
}
- ASSERT_EQ("Private Hire", XTokenData);
- ASSERT_EQ("X-TRANSPORT;PUBLIC=NO", XTokenName);
+ ASSERT_EQ("Private Hire", xTokenData);
+ ASSERT_EQ("X-TRANSPORT;PUBLIC=NO", xTokenName);
// Get the X-PHANTOM-STATUS token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestJournal.XTokensData.size() > 8){
+ if (testJournal.xTokensData.size() > 8){
- XTokenData = TestJournal.XTokensData[8];
+ xTokenData = testJournal.xTokensData[8];
}
- if (TestJournal.XTokensData.size() > 8){
+ if (testJournal.xTokensData.size() > 8){
- XTokenName = TestJournal.XTokensDataTokens[8];
+ xTokenName = testJournal.xTokensDataTokens[8];
}
- ASSERT_EQ("None", XTokenData);
- ASSERT_EQ("X-PHANTOM-STATUS;HELP=NONE", XTokenName);
+ ASSERT_EQ("None", xTokenData);
+ ASSERT_EQ("X-PHANTOM-STATUS;HELP=NONE", xTokenName);
}
\ No newline at end of file
TEST(iCalendarSaveJournal, SaveEventTests){
- CalendarJournalObject TestJournal;
- CalendarJournalObject TestJournal2;
+ CalendarJournalObject testJournal;
+ CalendarJournalObject testJournal2;
// Load the test journal information.
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestJournal.LoadFile("iCalendarJournal-Load1.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestJournal.ValidBaseObject());
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testJournal.LoadFile("iCalendarJournal-Load1.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testJournal.ValidBaseObject());
- ASSERT_EQ(CALENDAROBJECTSAVE_CANNOTOPEN, TestJournal.SaveFile("/stupidfilelocation/dontsavehere.ics"));
+ ASSERT_EQ(CALENDAROBJECTSAVE_CANNOTOPEN, testJournal.SaveFile("/stupidfilelocation/dontsavehere.ics"));
// Save the data to a string and compare the data.
// First journal file.
- std::string SaveDataComparison = "BEGIN:VCALENDAR\n"
+ std::string saveDataComparison = "BEGIN:VCALENDAR\n"
"VERSION:2.0\n"
"PRODID:-//Xestia//Calendar Unit Testing//KW\n"
"BEGIN:VJOURNAL\n"
"END:VJOURNAL\n"
"END:VCALENDAR";
- std::string SaveData;
+ std::string saveData;
- TestJournal.SaveString(&SaveData);
+ testJournal.SaveString(&saveData);
- ASSERT_EQ(SaveDataComparison, SaveData);
+ ASSERT_EQ(saveDataComparison, saveData);
- SaveData.clear();
+ saveData.clear();
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestJournal2.LoadFile("iCalendarJournal-Load2.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestJournal2.ValidBaseObject());
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testJournal2.LoadFile("iCalendarJournal-Load2.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testJournal2.ValidBaseObject());
- TestJournal2.SaveString(&SaveData);
+ testJournal2.SaveString(&saveData);
- SaveDataComparison = "BEGIN:VCALENDAR\n"
+ saveDataComparison = "BEGIN:VCALENDAR\n"
"VERSION:2.0\n"
"PRODID:-//Xestia//Calendar Unit Testing//KW\n"
"BEGIN:VJOURNAL\n"
"END:VJOURNAL\n"
"END:VCALENDAR";
- ASSERT_EQ(SaveDataComparison, SaveData);
+ ASSERT_EQ(saveDataComparison, saveData);
}
\ No newline at end of file
TEST(iCalendarTask, BasicTests){
- CalendarTaskObject TestTask;
+ CalendarTaskObject testTask;
- ASSERT_EQ(CALENDAROBJECTLOAD_MISSING, TestTask.LoadFile("iCalendarTask-Missing.vcf"));
- ASSERT_EQ(CALENDAROBJECTLOAD_CANNOTOPEN, TestTask.LoadFile("iCalendarTask-InvalidPermissions.vcf"));
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestTask.LoadFile("iCalendarTask-Load1.vcf"));
+ ASSERT_EQ(CALENDAROBJECTLOAD_MISSING, testTask.LoadFile("iCalendarTask-Missing.vcf"));
+ ASSERT_EQ(CALENDAROBJECTLOAD_CANNOTOPEN, testTask.LoadFile("iCalendarTask-InvalidPermissions.vcf"));
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTask.LoadFile("iCalendarTask-Load1.vcf"));
}
TEST(iCalendarTask, ObjectDataTests){
- CalendarTaskObject TestTask;
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestTask.LoadFile("iCalendarTask-Load2.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestTask.ValidBaseObject());
+ CalendarTaskObject testTask;
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTask.LoadFile("iCalendarTask-Load2.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testTask.ValidBaseObject());
// Tests for DTSTAMP.
- ASSERT_EQ("20160131T104500Z", TestTask.DateTimeStampData);
- ASSERT_EQ("OTHER=PARAM", TestTask.DateTimeStampTokens);
+ ASSERT_EQ("20160131T104500Z", testTask.dateTimeStampData);
+ ASSERT_EQ("OTHER=PARAM", testTask.dateTimeStampTokens);
// Tests for UID.
- ASSERT_EQ("b3a16392-ad86-4061-be53-c215af2306e1", TestTask.UniqueID);
- ASSERT_EQ("UNIQUEPARAM=CERTAINLY;OKAY=MAYBENOT", TestTask.UniqueIDTokens);
+ ASSERT_EQ("b3a16392-ad86-4061-be53-c215af2306e1", testTask.uniqueID);
+ ASSERT_EQ("UNIQUEPARAM=CERTAINLY;OKAY=MAYBENOT", testTask.uniqueIDTokens);
// Tests for CLASS.
- ASSERT_EQ("PUBLIC", TestTask.ClassData);
- ASSERT_EQ("CHOCOLATE=NONE", TestTask.ClassDataTokens);
+ ASSERT_EQ("PUBLIC", testTask.classData);
+ ASSERT_EQ("CHOCOLATE=NONE", testTask.classDataTokens);
// Tests for COMPLETED.
- ASSERT_EQ("20160131T110100Z", TestTask.CompletedData);
- ASSERT_EQ("LYING=NEVER", TestTask.CompletedDataTokens);
+ ASSERT_EQ("20160131T110100Z", testTask.completedData);
+ ASSERT_EQ("LYING=NEVER", testTask.completedDataTokens);
// Tests for CREATED.
- ASSERT_EQ("20160131T080000Z", TestTask.DateTimeCreatedData);
- ASSERT_EQ("CARAMEL=PLEASE", TestTask.DateTimeCreatedTokens);
+ ASSERT_EQ("20160131T080000Z", testTask.dateTimeCreatedData);
+ ASSERT_EQ("CARAMEL=PLEASE", testTask.dateTimeCreatedTokens);
// Tests for DESCRIPTION.
- std::string DescriptionData;
- std::string DescriptionAltRep;
- std::string DescriptionLanguage;
- std::string DescriptionTokens;
+ std::string descriptionData;
+ std::string descriptionAltRep;
+ std::string descriptionLanguage;
+ std::string descriptionTokens;
- if (TestTask.DescriptionList.begin() != TestTask.DescriptionList.end()){
- DescriptionData = TestTask.DescriptionList[0];
+ if (testTask.descriptionList.begin() != testTask.descriptionList.end()){
+ descriptionData = testTask.descriptionList[0];
}
- if (TestTask.DescriptionListAltRep.begin() != TestTask.DescriptionListAltRep.end()){
- DescriptionAltRep = TestTask.DescriptionListAltRep[0];
+ if (testTask.descriptionListAltRep.begin() != testTask.descriptionListAltRep.end()){
+ descriptionAltRep = testTask.descriptionListAltRep[0];
}
- if (TestTask.DescriptionListLanguage.begin() != TestTask.DescriptionListLanguage.end()){
- DescriptionLanguage = TestTask.DescriptionListLanguage[0];
+ if (testTask.descriptionListLanguage.begin() != testTask.descriptionListLanguage.end()){
+ descriptionLanguage = testTask.descriptionListLanguage[0];
}
- if (TestTask.DescriptionListTokens.begin() != TestTask.DescriptionListTokens.end()){
- DescriptionTokens = TestTask.DescriptionListTokens[0];
+ if (testTask.descriptionListTokens.begin() != testTask.descriptionListTokens.end()){
+ descriptionTokens = testTask.descriptionListTokens[0];
}
- ASSERT_EQ("This is a description of the todo.", DescriptionData);
- ASSERT_EQ("null:nodata", DescriptionAltRep);
- ASSERT_EQ("kw", DescriptionLanguage);
- ASSERT_EQ("EXAMPLE=TOKEN;MOREDATA=YES", DescriptionTokens);
+ ASSERT_EQ("This is a description of the todo.", descriptionData);
+ ASSERT_EQ("null:nodata", descriptionAltRep);
+ ASSERT_EQ("kw", descriptionLanguage);
+ ASSERT_EQ("EXAMPLE=TOKEN;MOREDATA=YES", descriptionTokens);
// Tests for DTSTART.
- ASSERT_EQ("20160131T103000Z", TestTask.DateTimeStartData);
- ASSERT_EQ("DATE-TIME", TestTask.DateTimeStartDataValue);
- ASSERT_EQ("Europe/Truro", TestTask.DateTimeStartDataTimeZoneID);
- ASSERT_EQ("PARAMONE=YES;PARAMTWO=NO", TestTask.DateTimeStartDataTokens);
+ ASSERT_EQ("20160131T103000Z", testTask.dateTimeStartData);
+ ASSERT_EQ("DATE-TIME", testTask.dateTimeStartDataValue);
+ ASSERT_EQ("Europe/Truro", testTask.dateTimeStartDataTimeZoneID);
+ ASSERT_EQ("PARAMONE=YES;PARAMTWO=NO", testTask.dateTimeStartDataTokens);
// Tests for GEO.
- ASSERT_EQ("20.0;20.0", TestTask.GeographicData);
- ASSERT_EQ("EXAMPLE=MOOP", TestTask.GeographicTokens);
+ ASSERT_EQ("20.0;20.0", testTask.geographicData);
+ ASSERT_EQ("EXAMPLE=MOOP", testTask.geographicTokens);
// Tests for LAST-MODIFIED.
- ASSERT_EQ("20160131T114200Z", TestTask.LastModifiedData);
- ASSERT_EQ("FUTURE=EVEN", TestTask.LastModifiedTokens);
+ ASSERT_EQ("20160131T114200Z", testTask.lastModifiedData);
+ ASSERT_EQ("FUTURE=EVEN", testTask.lastModifiedTokens);
// Tests for LOCATION.
- ASSERT_EQ("The Crystal Ceiling, Truro", TestTask.LocationData);
- ASSERT_EQ("null:nodata", TestTask.LocationDataAltRep);
- ASSERT_EQ("kw", TestTask.LocationDataLanguage);
- ASSERT_EQ("EXACT=YES", TestTask.LocationDataTokens);
+ ASSERT_EQ("The Crystal Ceiling, Truro", testTask.locationData);
+ ASSERT_EQ("null:nodata", testTask.locationDataAltRep);
+ ASSERT_EQ("kw", testTask.locationDataLanguage);
+ ASSERT_EQ("EXACT=YES", testTask.locationDataTokens);
// Tests for ORGANIZER.
- ASSERT_EQ("mailto:organiser@example.com", TestTask.OrganiserData);
- ASSERT_EQ("ExampleOrganiser", TestTask.OrganiserDataCommonName);
- ASSERT_EQ("null:nodata", TestTask.OrganiserDataDirectoryEntry);
- ASSERT_EQ("mailto:organiser.noreply@example.com", TestTask.OrganiserDataSentByParam);
- ASSERT_EQ("kw", TestTask.OrganiserDataLanguage);
- ASSERT_EQ("HAPPY=WEEKS", TestTask.OrganiserDataTokens);
+ ASSERT_EQ("mailto:organiser@example.com", testTask.organiserData);
+ ASSERT_EQ("ExampleOrganiser", testTask.organiserDataCommonName);
+ ASSERT_EQ("null:nodata", testTask.organiserDataDirectoryEntry);
+ ASSERT_EQ("mailto:organiser.noreply@example.com", testTask.organiserDataSentByParam);
+ ASSERT_EQ("kw", testTask.organiserDataLanguage);
+ ASSERT_EQ("HAPPY=WEEKS", testTask.organiserDataTokens);
// Tests for PERCENT-COMPLETE.
- ASSERT_EQ("42", TestTask.PercentCompleteData);
- ASSERT_EQ("DEEP=THOUGHT", TestTask.PercentCompleteTokens);
+ ASSERT_EQ("42", testTask.percentCompleteData);
+ ASSERT_EQ("DEEP=THOUGHT", testTask.percentCompleteTokens);
// Tests for PRIORITY.
- ASSERT_EQ(5, TestTask.PriorityData);
- ASSERT_EQ("STATUS=DEFAULT", TestTask.PriorityTokens);
+ ASSERT_EQ(5, testTask.priorityData);
+ ASSERT_EQ("STATUS=DEFAULT", testTask.priorityTokens);
// Tests for RECURRENCE-ID.
- ASSERT_EQ("20160131", TestTask.RecurranceIDData);
- ASSERT_EQ("Europe/Truro", TestTask.RecurranceIDDataTimeZoneParam);
- ASSERT_EQ("THISANDFUTURE", TestTask.RecurranceIDDataRangeParam);
- ASSERT_EQ("DATE", TestTask.RecurranceIDDataValue);
- ASSERT_EQ("EXAMPLE=DATA", TestTask.RecurranceIDDataTokens);
+ ASSERT_EQ("20160131", testTask.recurranceIDData);
+ ASSERT_EQ("Europe/Truro", testTask.recurranceIDDataTimeZoneParam);
+ ASSERT_EQ("THISANDFUTURE", testTask.recurranceIDDataRangeParam);
+ ASSERT_EQ("DATE", testTask.recurranceIDDataValue);
+ ASSERT_EQ("EXAMPLE=DATA", testTask.recurranceIDDataTokens);
// Tests for SEQUENCE.
- ASSERT_EQ(3, TestTask.SequenceData);
- ASSERT_EQ("TEST=YAY", TestTask.SequenceTokens);
+ ASSERT_EQ(3, testTask.sequenceData);
+ ASSERT_EQ("TEST=YAY", testTask.sequenceTokens);
// Tests for STATUS.
- ASSERT_EQ("2.0;Success", TestTask.StatusData);
- ASSERT_EQ("kw", TestTask.StatusLanguage);
- ASSERT_EQ("FAVOURITE=BEANS;NOTLIKE=UNKNOWN", TestTask.StatusTokens);
+ ASSERT_EQ("2.0;Success", testTask.statusData);
+ ASSERT_EQ("kw", testTask.statusLanguage);
+ ASSERT_EQ("FAVOURITE=BEANS;NOTLIKE=UNKNOWN", testTask.statusTokens);
// Tests for SUMMARY.
- ASSERT_EQ("A summary of the todo.", TestTask.SummaryData);
- ASSERT_EQ("null:nodata", TestTask.SummaryDataAltRep);
- ASSERT_EQ("kw", TestTask.SummaryDataLanguage);
- ASSERT_EQ("FAVOURITE=TOFU;NOTLIKE=NONE", TestTask.SummaryDataTokens);
+ ASSERT_EQ("A summary of the todo.", testTask.summaryData);
+ ASSERT_EQ("null:nodata", testTask.summaryDataAltRep);
+ ASSERT_EQ("kw", testTask.summaryDataLanguage);
+ ASSERT_EQ("FAVOURITE=TOFU;NOTLIKE=NONE", testTask.summaryDataTokens);
// Tests for URL.
- ASSERT_EQ("http://www.example.com/", TestTask.URLData);
- ASSERT_EQ("EXTERNAL=YES", TestTask.URLDataTokens);
+ ASSERT_EQ("http://www.example.com/", testTask.urlData);
+ ASSERT_EQ("EXTERNAL=YES", testTask.urlDataTokens);
// Tests for RRULE.
- ASSERT_EQ("FREQ=DAILY;COUNT=10", TestTask.RecurranceRuleData);
- ASSERT_EQ("TEST=DATA", TestTask.RecurranceRuleDataTokens);
+ ASSERT_EQ("FREQ=DAILY;COUNT=10", testTask.recurranceRuleData);
+ ASSERT_EQ("TEST=DATA", testTask.recurranceRuleDataTokens);
// Tests for DUE.
- ASSERT_EQ("20160131T150000Z", TestTask.DueData);
- ASSERT_EQ("Europe/Truro", TestTask.DueDataTimeZoneID);
- ASSERT_EQ("DATE-TIME", TestTask.DueDataValue);
- ASSERT_EQ("TEST=YES", TestTask.DueDataTokens);
+ ASSERT_EQ("20160131T150000Z", testTask.dueData);
+ ASSERT_EQ("Europe/Truro", testTask.dueDataTimeZoneID);
+ ASSERT_EQ("DATE-TIME", testTask.dueDataValue);
+ ASSERT_EQ("TEST=YES", testTask.dueDataTokens);
// Tests for DURATION.
- CalendarTaskObject TestTask2;
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestTask2.LoadFile("iCalendarTask-Load3.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestTask2.ValidBaseObject());
+ CalendarTaskObject testTask2;
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTask2.LoadFile("iCalendarTask-Load3.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testTask2.ValidBaseObject());
- ASSERT_EQ("PT15M", TestTask2.DurationData);
- ASSERT_EQ("TEST=YES", TestTask2.DurationDataTokens);
+ ASSERT_EQ("PT15M", testTask2.durationData);
+ ASSERT_EQ("TEST=YES", testTask2.durationDataTokens);
// Tests for ATTACH. First ATTACH property.
- std::string AttachData;
- std::string AttachDataFormatType;
- std::string AttachDataValue;
- std::string AttachDataEncoding;
- std::string AttachDataTokens;
+ std::string attachData;
+ std::string attachDataFormatType;
+ std::string attachDataValue;
+ std::string attachDataEncoding;
+ std::string attachDataTokens;
- if (TestTask.AttachList.begin() != TestTask.AttachList.end()){
+ if (testTask.attachList.begin() != testTask.attachList.end()){
- AttachData = TestTask.AttachList[0];
+ attachData = testTask.attachList[0];
}
- if (TestTask.AttachListFormatType.begin() != TestTask.AttachListFormatType.end()){
+ if (testTask.attachListFormatType.begin() != testTask.attachListFormatType.end()){
- AttachDataFormatType = TestTask.AttachListFormatType[0];
+ attachDataFormatType = testTask.attachListFormatType[0];
}
- ASSERT_EQ("http://www.example.com/", AttachData);
- ASSERT_EQ("application/internet-shortcut", AttachDataFormatType);
+ ASSERT_EQ("http://www.example.com/", attachData);
+ ASSERT_EQ("application/internet-shortcut", attachDataFormatType);
// Second ATTACH property.
- AttachData.clear();
- AttachDataFormatType.clear();
- AttachDataValue.clear();
- AttachDataEncoding.clear();
+ attachData.clear();
+ attachDataFormatType.clear();
+ attachDataValue.clear();
+ attachDataEncoding.clear();
- if (TestTask.AttachList.size() > 1){
+ if (testTask.attachList.size() > 1){
- AttachData = TestTask.AttachList[1];
+ attachData = testTask.attachList[1];
}
- if (TestTask.AttachListFormatType.size() > 1){
+ if (testTask.attachListFormatType.size() > 1){
- AttachDataFormatType = TestTask.AttachListFormatType[1];
+ attachDataFormatType = testTask.attachListFormatType[1];
}
- ASSERT_EQ("http://www.example.com/page2.html", AttachData);
- ASSERT_EQ("application/internet-shortcut", AttachDataFormatType);
+ ASSERT_EQ("http://www.example.com/page2.html", attachData);
+ ASSERT_EQ("application/internet-shortcut", attachDataFormatType);
// Third ATTACH property.
- AttachData.clear();
- AttachDataFormatType.clear();
- AttachDataValue.clear();
- AttachDataEncoding.clear();
- AttachDataTokens.clear();
+ attachData.clear();
+ attachDataFormatType.clear();
+ attachDataValue.clear();
+ attachDataEncoding.clear();
+ attachDataTokens.clear();
- if (TestTask.AttachList.size() > 2){
+ if (testTask.attachList.size() > 2){
- AttachData = TestTask.AttachList[2];
+ attachData = testTask.attachList[2];
}
- if (TestTask.AttachListFormatType.size() > 2){
+ if (testTask.attachListFormatType.size() > 2){
- AttachDataFormatType = TestTask.AttachListFormatType[2];
+ attachDataFormatType = testTask.attachListFormatType[2];
}
- if (TestTask.AttachListValue.size() > 2){
+ if (testTask.attachListValue.size() > 2){
- AttachDataValue = TestTask.AttachListValue[2];
+ attachDataValue = testTask.attachListValue[2];
}
- if (TestTask.AttachListFormatType.size() > 2){
+ if (testTask.attachListFormatType.size() > 2){
- AttachDataEncoding = TestTask.AttachListEncoding[2];
+ attachDataEncoding = testTask.attachListEncoding[2];
}
- if (TestTask.AttachListTokens.size() > 2){
+ if (testTask.attachListTokens.size() > 2){
- AttachDataTokens = TestTask.AttachListTokens[2];
+ attachDataTokens = testTask.attachListTokens[2];
}
- ASSERT_EQ("VGhpcyBpcyBhbiBleGFtcGxlIGZpbGU=", AttachData);
- ASSERT_EQ("text/plain", AttachDataFormatType);
- ASSERT_EQ("BASE64", AttachDataEncoding);
- ASSERT_EQ("BINARY", AttachDataValue);
- ASSERT_EQ("STUPID=EXAMPLE", AttachDataTokens);
+ ASSERT_EQ("VGhpcyBpcyBhbiBleGFtcGxlIGZpbGU=", attachData);
+ ASSERT_EQ("text/plain", attachDataFormatType);
+ ASSERT_EQ("BASE64", attachDataEncoding);
+ ASSERT_EQ("BINARY", attachDataValue);
+ ASSERT_EQ("STUPID=EXAMPLE", attachDataTokens);
// Tests for ATTENDEE. First ATTENDEE property.
- std::string AttendeeDataMember;
- std::string AttendeeDataDelegatedFrom;
- std::string AttendeeDataDelegatedTo;
- std::string AttendeeDataRole;
- std::string AttendeeDataRSVP;
- std::string AttendeeDataDirectoryEntry;
- std::string AttendeeDataSentBy;
- std::string AttendeeDataCommonName;
- std::string AttendeeDataCalendarUserType;
- std::string AttendeeDataParticipationStatus;
- std::string AttendeeDataLanguage;
- std::string AttendeeDataTokens;
- std::string AttendeeData;
+ std::string attendeeDataMember;
+ std::string attendeeDataDelegatedFrom;
+ std::string attendeeDataDelegatedTo;
+ std::string attendeeDataRole;
+ std::string attendeeDataRSVP;
+ std::string attendeeDataDirectoryEntry;
+ std::string attendeeDataSentBy;
+ std::string attendeeDataCommonName;
+ std::string attendeeDataCalendarUserType;
+ std::string attendeeDataParticipationStatus;
+ std::string attendeeDataLanguage;
+ std::string attendeeDataTokens;
+ std::string attendeeData;
- if (TestTask.AttendeeList.begin() != TestTask.AttendeeList.end()){
+ if (testTask.attendeeList.begin() != testTask.attendeeList.end()){
- AttendeeData = TestTask.AttendeeList[0];
+ attendeeData = testTask.attendeeList[0];
}
- ASSERT_EQ("Attendee One", AttendeeData);
+ ASSERT_EQ("Attendee One", attendeeData);
// Second ATTENDEE property.
- AttendeeData.clear();
+ attendeeData.clear();
- if (TestTask.AttendeeList.size() > 1){
+ if (testTask.attendeeList.size() > 1){
- AttendeeData = TestTask.AttendeeList[1];
+ attendeeData = testTask.attendeeList[1];
}
- if (TestTask.AttendeeList.size() > 1){
+ if (testTask.attendeeList.size() > 1){
- AttendeeDataDelegatedFrom = TestTask.AttendeeListDelegatedFrom[1];
+ attendeeDataDelegatedFrom = testTask.attendeeListDelegatedFrom[1];
}
- if (TestTask.AttendeeList.size() > 1){
+ if (testTask.attendeeList.size() > 1){
- AttendeeDataDelegatedTo = TestTask.AttendeeListDelegatedTo[1];
+ attendeeDataDelegatedTo = testTask.attendeeListDelegatedTo[1];
}
- if (TestTask.AttendeeList.size() > 1){
+ if (testTask.attendeeList.size() > 1){
- AttendeeDataRole = TestTask.AttendeeListRole[1];
+ attendeeDataRole = testTask.attendeeListRole[1];
}
- if (TestTask.AttendeeList.size() > 1){
+ if (testTask.attendeeList.size() > 1){
- AttendeeDataRSVP = TestTask.AttendeeListRSVP[1];
+ attendeeDataRSVP = testTask.attendeeListRSVP[1];
}
- ASSERT_EQ("Attendee Two", AttendeeData);
- ASSERT_EQ("mailto:delegated.from@example.com", AttendeeDataDelegatedFrom);
- ASSERT_EQ("mailto:delegated.to@example.com", AttendeeDataDelegatedTo);
- ASSERT_EQ("CHAIR", AttendeeDataRole);
- ASSERT_EQ("TRUE", AttendeeDataRSVP);
+ ASSERT_EQ("Attendee Two", attendeeData);
+ ASSERT_EQ("mailto:delegated.from@example.com", attendeeDataDelegatedFrom);
+ ASSERT_EQ("mailto:delegated.to@example.com", attendeeDataDelegatedTo);
+ ASSERT_EQ("CHAIR", attendeeDataRole);
+ ASSERT_EQ("TRUE", attendeeDataRSVP);
// Third ATTENDEE property.
- AttendeeData.clear();
+ attendeeData.clear();
- if (TestTask.AttendeeList.size() > 2){
+ if (testTask.attendeeList.size() > 2){
- AttendeeData = TestTask.AttendeeList[2];
+ attendeeData = testTask.attendeeList[2];
}
- if (TestTask.AttendeeList.size() > 2){
+ if (testTask.attendeeList.size() > 2){
- AttendeeDataDirectoryEntry = TestTask.AttendeeListDirectoryEntry[2];
+ attendeeDataDirectoryEntry = testTask.attendeeListDirectoryEntry[2];
}
- if (TestTask.AttendeeList.size() > 2){
+ if (testTask.attendeeList.size() > 2){
- AttendeeDataSentBy = TestTask.AttendeeListSentBy[2];
+ attendeeDataSentBy = testTask.attendeeListSentBy[2];
}
- if (TestTask.AttendeeList.size() > 2){
+ if (testTask.attendeeList.size() > 2){
- AttendeeDataCommonName = TestTask.AttendeeListCommonName[2];
+ attendeeDataCommonName = testTask.attendeeListCommonName[2];
}
- if (TestTask.AttendeeList.size() > 2){
+ if (testTask.attendeeList.size() > 2){
- AttendeeDataCalendarUserType = TestTask.AttendeeListCalendarUserType[2];
+ attendeeDataCalendarUserType = testTask.attendeeListCalendarUserType[2];
}
- if (TestTask.AttendeeList.size() > 2){
+ if (testTask.attendeeList.size() > 2){
- AttendeeDataParticipationStatus = TestTask.AttendeeListParticipationStatus[2];
+ attendeeDataParticipationStatus = testTask.attendeeListParticipationStatus[2];
}
- if (TestTask.AttendeeList.size() > 2){
+ if (testTask.attendeeList.size() > 2){
- AttendeeDataLanguage = TestTask.AttendeeListLanguage[2];
+ attendeeDataLanguage = testTask.attendeeListLanguage[2];
}
- if (TestTask.AttendeeList.size() > 2){
+ if (testTask.attendeeList.size() > 2){
- AttendeeDataTokens = TestTask.AttendeeListTokens[2];
+ attendeeDataTokens = testTask.attendeeListTokens[2];
}
- ASSERT_EQ("Attendee Three", AttendeeData);
- ASSERT_EQ("null:nodata", AttendeeDataDirectoryEntry);
- ASSERT_EQ("mailto:sent.by@example.com", AttendeeDataSentBy);
- ASSERT_EQ("Attendee The Third", AttendeeDataCommonName);
- ASSERT_EQ("INDIVIDUAL", AttendeeDataCalendarUserType);
- ASSERT_EQ("ACCEPTED", AttendeeDataParticipationStatus);
- ASSERT_EQ("kw", AttendeeDataLanguage);
- ASSERT_EQ("EXAMPLE=DATA", AttendeeDataTokens);
+ ASSERT_EQ("Attendee Three", attendeeData);
+ ASSERT_EQ("null:nodata", attendeeDataDirectoryEntry);
+ ASSERT_EQ("mailto:sent.by@example.com", attendeeDataSentBy);
+ ASSERT_EQ("Attendee The Third", attendeeDataCommonName);
+ ASSERT_EQ("INDIVIDUAL", attendeeDataCalendarUserType);
+ ASSERT_EQ("ACCEPTED", attendeeDataParticipationStatus);
+ ASSERT_EQ("kw", attendeeDataLanguage);
+ ASSERT_EQ("EXAMPLE=DATA", attendeeDataTokens);
// Get the first CATEGORIES.
- std::string CategoryData;
+ std::string categoryData;
- if (TestTask.CategoriesList.begin() != TestTask.CategoriesList.end()){
+ if (testTask.categoriesList.begin() != testTask.categoriesList.end()){
- CategoryData = TestTask.CategoriesList[0];
+ categoryData = testTask.categoriesList[0];
}
- ASSERT_EQ("CATEGORY ONE, CATEGORY TWO", CategoryData);
+ ASSERT_EQ("CATEGORY ONE, CATEGORY TWO", categoryData);
- CategoryData.clear();
+ categoryData.clear();
- std::string CategoryLanguage;
+ std::string categoryLanguage;
// Get the second CATEGORIES.
- if (TestTask.CategoriesList.size() > 1){
+ if (testTask.categoriesList.size() > 1){
- CategoryData = TestTask.CategoriesList[1];
+ categoryData = testTask.categoriesList[1];
}
- if (TestTask.CategoriesList.size() > 1){
+ if (testTask.categoriesList.size() > 1){
- CategoryLanguage = TestTask.CategoriesListLanguage[1];
+ categoryLanguage = testTask.categoriesListLanguage[1];
}
- ASSERT_EQ("CATEGORY THREE, CATEGORY FOUR", CategoryData);
- ASSERT_EQ("en", CategoryLanguage);
+ ASSERT_EQ("CATEGORY THREE, CATEGORY FOUR", categoryData);
+ ASSERT_EQ("en", categoryLanguage);
- CategoryData.clear();
- CategoryLanguage.clear();
+ categoryData.clear();
+ categoryLanguage.clear();
// Get the third CATEGORIES.
- std::string CategoryTokens;
+ std::string categoryTokens;
- if (TestTask.CategoriesList.size() > 2){
+ if (testTask.categoriesList.size() > 2){
- CategoryData = TestTask.CategoriesList[2];
+ categoryData = testTask.categoriesList[2];
}
- if (TestTask.CategoriesList.size() > 2){
+ if (testTask.categoriesList.size() > 2){
- CategoryLanguage = TestTask.CategoriesListLanguage[2];
+ categoryLanguage = testTask.categoriesListLanguage[2];
}
- if (TestTask.CategoriesList.size() > 2){
+ if (testTask.categoriesList.size() > 2){
- CategoryTokens = TestTask.CategoriesListTokens[2];
+ categoryTokens = testTask.categoriesListTokens[2];
}
- ASSERT_EQ("CATEGORY FIVE, CATEGORY SIX, CATEGORY SEVEN", CategoryData);
- ASSERT_EQ("en-GB", CategoryLanguage);
- ASSERT_EQ("SAMPLE=TOKEN", CategoryTokens);
+ ASSERT_EQ("CATEGORY FIVE, CATEGORY SIX, CATEGORY SEVEN", categoryData);
+ ASSERT_EQ("en-GB", categoryLanguage);
+ ASSERT_EQ("SAMPLE=TOKEN", categoryTokens);
// Get the first COMMENT.
- std::string CommentData;
+ std::string commentData;
- if (TestTask.CommentList.begin() != TestTask.CommentList.end()){
+ if (testTask.commentList.begin() != testTask.commentList.end()){
- CommentData = TestTask.CommentList[0];
+ commentData = testTask.commentList[0];
}
- ASSERT_EQ("This is the first comment.", CommentData);
+ ASSERT_EQ("This is the first comment.", commentData);
// Get the second COMMENT.
- CommentData.clear();
+ commentData.clear();
- std::string CommentDataAltRep;
- std::string CommentDataLanguage;
+ std::string commentDataAltRep;
+ std::string commentDataLanguage;
- if (TestTask.CommentList.size() > 1){
+ if (testTask.commentList.size() > 1){
- CommentData = TestTask.CommentList[1];
+ commentData = testTask.commentList[1];
}
- if (TestTask.CommentList.size() > 1){
+ if (testTask.commentList.size() > 1){
- CommentDataAltRep = TestTask.CommentListAltRep[1];
+ commentDataAltRep = testTask.commentListAltRep[1];
}
- if (TestTask.CommentList.size() > 1){
+ if (testTask.commentList.size() > 1){
- CommentDataLanguage = TestTask.CommentListLanguage[1];
+ commentDataLanguage = testTask.commentListLanguage[1];
}
- ASSERT_EQ("This is the second comment.", CommentData);
- ASSERT_EQ("null:nodata", CommentDataAltRep);
- ASSERT_EQ("en", CommentDataLanguage);
+ ASSERT_EQ("This is the second comment.", commentData);
+ ASSERT_EQ("null:nodata", commentDataAltRep);
+ ASSERT_EQ("en", commentDataLanguage);
// Get the third COMMENT.
- CommentData.clear();
+ commentData.clear();
- std::string CommentDataTokens;
+ std::string commentDataTokens;
- if (TestTask.CommentList.size() > 2){
+ if (testTask.commentList.size() > 2){
- CommentData = TestTask.CommentList[2];
+ commentData = testTask.commentList[2];
}
- if (TestTask.CommentList.size() > 2){
+ if (testTask.commentList.size() > 2){
- CommentDataTokens = TestTask.CommentListTokens[2];
+ commentDataTokens = testTask.commentListTokens[2];
}
- ASSERT_EQ("This is the third comment.", CommentData);
- ASSERT_EQ("ZEBRAS=YES", CommentDataTokens);
+ ASSERT_EQ("This is the third comment.", commentData);
+ ASSERT_EQ("ZEBRAS=YES", commentDataTokens);
// Get the first CONTACT.
- std::string ContactData;
+ std::string contactData;
- if (TestTask.ContactList.begin() != TestTask.ContactList.end()){
+ if (testTask.contactList.begin() != testTask.contactList.end()){
- ContactData = TestTask.ContactList[0];
+ contactData = testTask.contactList[0];
}
- ASSERT_EQ("First Contact", ContactData);
+ ASSERT_EQ("First Contact", contactData);
// Get the second CONTACT.
- ContactData.clear();
+ contactData.clear();
- std::string ContactDataAltRep;
- std::string ContactDataLanguage;
+ std::string contactDataAltRep;
+ std::string contactDataLanguage;
- if (TestTask.ContactList.size() > 1){
+ if (testTask.contactList.size() > 1){
- ContactData = TestTask.ContactList[1];
+ contactData = testTask.contactList[1];
}
- if (TestTask.ContactList.size() > 1){
+ if (testTask.contactList.size() > 1){
- ContactDataAltRep = TestTask.ContactListAltRep[1];
+ contactDataAltRep = testTask.contactListAltRep[1];
}
- if (TestTask.ContactList.size() > 1){
+ if (testTask.contactList.size() > 1){
- ContactDataLanguage = TestTask.ContactListLanguage[1];
+ contactDataLanguage = testTask.contactListLanguage[1];
}
- ASSERT_EQ("Second Contact", ContactData);
- ASSERT_EQ("null:nodata", ContactDataAltRep);
- ASSERT_EQ("en-GB", ContactDataLanguage);
+ ASSERT_EQ("Second Contact", contactData);
+ ASSERT_EQ("null:nodata", contactDataAltRep);
+ ASSERT_EQ("en-GB", contactDataLanguage);
// Get the third CONTACT.
- ContactData.clear();
+ contactData.clear();
- std::string ContactDataTokens;
+ std::string contactDataTokens;
- if (TestTask.ContactList.size() > 2){
+ if (testTask.contactList.size() > 2){
- ContactData = TestTask.ContactList[2];
+ contactData = testTask.contactList[2];
}
- if (TestTask.ContactList.size() > 2){
+ if (testTask.contactList.size() > 2){
- ContactDataTokens = TestTask.ContactListTokens[2];
+ contactDataTokens = testTask.contactListTokens[2];
}
- ASSERT_EQ("Third Contact", ContactData);
- ASSERT_EQ("ZEBRAS=NO", ContactDataTokens);
+ ASSERT_EQ("Third Contact", contactData);
+ ASSERT_EQ("ZEBRAS=NO", contactDataTokens);
// Get the first EXDATE.
- std::string ExcludeDate;
+ std::string excludeDate;
- if (TestTask.ExcludeDateData.begin() != TestTask.ExcludeDateData.end()){
+ if (testTask.excludeDateData.begin() != testTask.excludeDateData.end()){
- ExcludeDate = TestTask.ExcludeDateData[0];
+ excludeDate = testTask.excludeDateData[0];
}
- ASSERT_EQ("20160125T120000Z", ExcludeDate);
+ ASSERT_EQ("20160125T120000Z", excludeDate);
// Get the second EXDATE.
- ExcludeDate.clear();
+ excludeDate.clear();
- std::string ExcludeDataTimeZoneParam;
- std::string ExcludeDataValue;
+ std::string excludeDataTimeZoneParam;
+ std::string excludeDataValue;
- if (TestTask.ContactList.size() > 1){
+ if (testTask.contactList.size() > 1){
- ExcludeDate = TestTask.ExcludeDateData[1];
+ excludeDate = testTask.excludeDateData[1];
}
- if (TestTask.ContactList.size() > 1){
+ if (testTask.contactList.size() > 1){
- ExcludeDataTimeZoneParam = TestTask.ExcludeDateDataTimeZoneParam[1];
+ excludeDataTimeZoneParam = testTask.excludeDateDataTimeZoneParam[1];
}
- if (TestTask.ContactList.size() > 1){
+ if (testTask.contactList.size() > 1){
- ExcludeDataValue = TestTask.ExcludeDateDataValue[1];
+ excludeDataValue = testTask.excludeDateDataValue[1];
}
- ASSERT_EQ("20160125T130000Z", ExcludeDate);
- ASSERT_EQ("DATE-TIME", ExcludeDataValue);
- ASSERT_EQ("Europe/Truro", ExcludeDataTimeZoneParam);
+ ASSERT_EQ("20160125T130000Z", excludeDate);
+ ASSERT_EQ("DATE-TIME", excludeDataValue);
+ ASSERT_EQ("Europe/Truro", excludeDataTimeZoneParam);
// Get the third EXDATE.
- ExcludeDate.clear();
+ excludeDate.clear();
- std::string ExcludeDataTokens;
+ std::string excludeDataTokens;
- if (TestTask.ContactList.size() > 2){
+ if (testTask.contactList.size() > 2){
- ExcludeDate = TestTask.ExcludeDateData[2];
+ excludeDate = testTask.excludeDateData[2];
}
- if (TestTask.ContactList.size() > 2){
+ if (testTask.contactList.size() > 2){
- ExcludeDataTokens = TestTask.ExcludeDateDataTokens[2];
+ excludeDataTokens = testTask.excludeDateDataTokens[2];
}
- ASSERT_EQ("20160125T133000Z", ExcludeDate);
- ASSERT_EQ("ZOOP=ZIPPO", ExcludeDataTokens);
+ ASSERT_EQ("20160125T133000Z", excludeDate);
+ ASSERT_EQ("ZOOP=ZIPPO", excludeDataTokens);
// Get the first REQUEST-STATUS.
- std::string RequestStatus;
+ std::string requestStatus;
- if (TestTask.RequestStatusData.begin() != TestTask.RequestStatusData.end()){
+ if (testTask.requestStatusData.begin() != testTask.requestStatusData.end()){
- RequestStatus = TestTask.RequestStatusData[0];
+ requestStatus = testTask.requestStatusData[0];
}
- ASSERT_EQ("2.0;Success", RequestStatus);
+ ASSERT_EQ("2.0;Success", requestStatus);
// Get the second REQUEST-STATUS.
- RequestStatus.clear();
+ requestStatus.clear();
- std::string RequestLanguage;
+ std::string requestLanguage;
- if (TestTask.ContactList.size() > 1){
+ if (testTask.contactList.size() > 1){
- RequestStatus = TestTask.RequestStatusData[1];
+ requestStatus = testTask.requestStatusData[1];
}
- if (TestTask.ContactList.size() > 1){
+ if (testTask.contactList.size() > 1){
- RequestLanguage = TestTask.RequestStatusLanguage[1];
+ requestLanguage = testTask.requestStatusLanguage[1];
}
- ASSERT_EQ("3.42;Really big irrecoverable error caused by the user", RequestStatus);
- ASSERT_EQ("en", RequestLanguage);
+ ASSERT_EQ("3.42;Really big irrecoverable error caused by the user", requestStatus);
+ ASSERT_EQ("en", requestLanguage);
// Get the third REQUEST-STATUS.
- RequestStatus.clear();
+ requestStatus.clear();
- std::string RequestTokens;
+ std::string requestTokens;
- if (TestTask.ContactList.size() > 2){
+ if (testTask.contactList.size() > 2){
- RequestStatus = TestTask.RequestStatusData[2];
+ requestStatus = testTask.requestStatusData[2];
}
- if (TestTask.ContactList.size() > 2){
+ if (testTask.contactList.size() > 2){
- RequestTokens = TestTask.RequestStatusTokens[2];
+ requestTokens = testTask.requestStatusTokens[2];
}
- ASSERT_EQ("3.7;Invalid calendar user", RequestStatus);
- ASSERT_EQ("USER=MISSING", RequestTokens);
+ ASSERT_EQ("3.7;Invalid calendar user", requestStatus);
+ ASSERT_EQ("USER=MISSING", requestTokens);
// Get the first RELATED-TO.
- std::string RelatedTo;
+ std::string relatedTo;
- if (TestTask.RelatedToData.begin() != TestTask.RelatedToData.end()){
+ if (testTask.relatedToData.begin() != testTask.relatedToData.end()){
- RelatedTo = TestTask.RelatedToData[0];
+ relatedTo = testTask.relatedToData[0];
}
- ASSERT_EQ("person.1@example.com", RelatedTo);
+ ASSERT_EQ("person.1@example.com", relatedTo);
// Get the second RELATED-TO.
- RelatedTo.clear();
+ relatedTo.clear();
- std::string RelatedToType;
+ std::string relatedToType;
- if (TestTask.RelatedToData.size() > 1){
+ if (testTask.relatedToData.size() > 1){
- RelatedTo = TestTask.RelatedToData[1];
+ relatedTo = testTask.relatedToData[1];
}
- if (TestTask.RelatedToData.size() > 1){
+ if (testTask.relatedToData.size() > 1){
- RelatedToType = TestTask.RelatedToDataRelationType[1];
+ relatedToType = testTask.relatedToDataRelationType[1];
}
- ASSERT_EQ("person.2@example.com", RelatedTo);
- ASSERT_EQ("PARENT", RelatedToType);
+ ASSERT_EQ("person.2@example.com", relatedTo);
+ ASSERT_EQ("PARENT", relatedToType);
// Get the third RELATED-TO.
- RelatedTo.clear();
+ relatedTo.clear();
- std::string RelatedToTokens;
+ std::string relatedToTokens;
- if (TestTask.RelatedToData.size() > 2){
+ if (testTask.relatedToData.size() > 2){
- RelatedTo = TestTask.RelatedToData[2];
+ relatedTo = testTask.relatedToData[2];
}
- if (TestTask.RelatedToData.size() > 2){
+ if (testTask.relatedToData.size() > 2){
- RelatedToTokens = TestTask.RelatedToDataTokens[2];
+ relatedToTokens = testTask.relatedToDataTokens[2];
}
- ASSERT_EQ("person.3@example.com", RelatedTo);
- ASSERT_EQ("SCHOOL=MEETING", RelatedToTokens);
+ ASSERT_EQ("person.3@example.com", relatedTo);
+ ASSERT_EQ("SCHOOL=MEETING", relatedToTokens);
// Get the first RESOURCES.
- std::string Resources;
+ std::string resources;
- if (TestTask.ResourcesData.begin() != TestTask.ResourcesData.end()){
+ if (testTask.resourcesData.begin() != testTask.resourcesData.end()){
- Resources = TestTask.ResourcesData[0];
+ resources = testTask.resourcesData[0];
}
- ASSERT_EQ("DMAC RECEIVER", Resources);
+ ASSERT_EQ("DMAC RECEIVER", resources);
// Get the second RESOURCES.
- Resources.clear();
+ resources.clear();
- std::string ResourcesLanguage;
+ std::string resourcesLanguage;
- if (TestTask.ResourcesData.size() > 1){
+ if (testTask.resourcesData.size() > 1){
- Resources = TestTask.ResourcesData[1];
+ resources = testTask.resourcesData[1];
}
- if (TestTask.ResourcesData.size() > 1){
+ if (testTask.resourcesData.size() > 1){
- ResourcesLanguage = TestTask.ResourcesDataLanguage[1];
+ resourcesLanguage = testTask.resourcesDataLanguage[1];
}
- ASSERT_EQ("PAL-I TELEVISION SET", Resources);
- ASSERT_EQ("en", ResourcesLanguage);
+ ASSERT_EQ("PAL-I TELEVISION SET", resources);
+ ASSERT_EQ("en", resourcesLanguage);
// Get the third RESOURCES.
- Resources.clear();
+ resources.clear();
- std::string ResourcesAltRep;
- std::string ResourcesTokens;
+ std::string resourcesAltRep;
+ std::string resourcesTokens;
- if (TestTask.ResourcesData.size() > 2){
+ if (testTask.resourcesData.size() > 2){
- Resources = TestTask.ResourcesData[2];
+ resources = testTask.resourcesData[2];
}
- if (TestTask.ResourcesData.size() > 2){
+ if (testTask.resourcesData.size() > 2){
- ResourcesAltRep = TestTask.ResourcesDataAltRep[2];
+ resourcesAltRep = testTask.resourcesDataAltRep[2];
}
- if (TestTask.ResourcesData.size() > 2){
+ if (testTask.resourcesData.size() > 2){
- ResourcesTokens = TestTask.ResourcesDataTokens[2];
+ resourcesTokens = testTask.resourcesDataTokens[2];
}
- ASSERT_EQ("PAL/SECAM VCR", Resources);
- ASSERT_EQ("null:nodata", ResourcesAltRep);
- ASSERT_EQ("STATUS=BROKEN", ResourcesTokens);
+ ASSERT_EQ("PAL/SECAM VCR", resources);
+ ASSERT_EQ("null:nodata", resourcesAltRep);
+ ASSERT_EQ("STATUS=BROKEN", resourcesTokens);
// Get the first RDATE.
- std::string RecurrenceDate;
+ std::string recurrenceDate;
- if (TestTask.RecurranceDateData.begin() != TestTask.RecurranceDateData.end()){
+ if (testTask.recurranceDateData.begin() != testTask.recurranceDateData.end()){
- RecurrenceDate = TestTask.RecurranceDateData[0];
+ recurrenceDate = testTask.recurranceDateData[0];
}
- ASSERT_EQ("20160120", RecurrenceDate);
+ ASSERT_EQ("20160120", recurrenceDate);
// Get the second RDATE.
- RecurrenceDate.clear();
+ recurrenceDate.clear();
- std::string RecurrenceDateTimeZoneParam;
- std::string RecurrenceDateValue;
+ std::string recurrenceDateTimeZoneParam;
+ std::string recurrenceDateValue;
- if (TestTask.RecurranceDateData.size() > 1){
+ if (testTask.recurranceDateData.size() > 1){
- RecurrenceDate = TestTask.RecurranceDateData[1];
+ recurrenceDate = testTask.recurranceDateData[1];
}
- if (TestTask.RecurranceDateData.size() > 1){
+ if (testTask.recurranceDateData.size() > 1){
- RecurrenceDateTimeZoneParam = TestTask.RecurranceDateDataTimeZoneParam[1];
+ recurrenceDateTimeZoneParam = testTask.recurranceDateDataTimeZoneParam[1];
}
- if (TestTask.RecurranceDateData.size() > 1){
+ if (testTask.recurranceDateData.size() > 1){
- RecurrenceDateValue = TestTask.RecurranceDateDataValue[1];
+ recurrenceDateValue = testTask.recurranceDateDataValue[1];
}
- ASSERT_EQ("20160121", RecurrenceDate);
- ASSERT_EQ("DATE", RecurrenceDateValue);
- ASSERT_EQ("Europe/Truro", RecurrenceDateTimeZoneParam);
+ ASSERT_EQ("20160121", recurrenceDate);
+ ASSERT_EQ("DATE", recurrenceDateValue);
+ ASSERT_EQ("Europe/Truro", recurrenceDateTimeZoneParam);
// Get the third RDATE.
- RecurrenceDate.clear();
+ recurrenceDate.clear();
- std::string RecurrenceTokens;
+ std::string recurrenceTokens;
- if (TestTask.RecurranceDateData.size() > 2){
+ if (testTask.recurranceDateData.size() > 2){
- RecurrenceDate = TestTask.RecurranceDateData[2];
+ recurrenceDate = testTask.recurranceDateData[2];
}
- if (TestTask.RecurranceDateData.size() > 2){
+ if (testTask.recurranceDateData.size() > 2){
- RecurrenceTokens = TestTask.RecurranceDateDataTokens[2];
+ recurrenceTokens = testTask.recurranceDateDataTokens[2];
}
- ASSERT_EQ("20160520", RecurrenceDate);
- ASSERT_EQ("ZILCH=DATA", RecurrenceTokens);
+ ASSERT_EQ("20160520", recurrenceDate);
+ ASSERT_EQ("ZILCH=DATA", recurrenceTokens);
// Get the first X-EXAMPLE1 token.
- std::string XTokenName;
- std::string XTokenData;
+ std::string xTokenName;
+ std::string xTokenData;
- if (TestTask.XTokensData.size() != 0 ){
+ if (testTask.xTokensData.size() != 0 ){
- XTokenData = TestTask.XTokensData[0];
+ xTokenData = testTask.xTokensData[0];
}
- if (TestTask.XTokensData.size() != 0){
+ if (testTask.xTokensData.size() != 0){
- XTokenName = TestTask.XTokensDataTokens[0];
+ xTokenName = testTask.xTokensDataTokens[0];
}
- ASSERT_EQ("Moo", XTokenData);
- ASSERT_EQ("X-EXAMPLE1", XTokenName);
+ ASSERT_EQ("Moo", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1", xTokenName);
// Get the second X-EXAMPLE1 token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestTask.XTokensData.size() > 1){
+ if (testTask.xTokensData.size() > 1){
- XTokenData = TestTask.XTokensData[1];
+ xTokenData = testTask.xTokensData[1];
}
- if (TestTask.XTokensData.size() > 1){
+ if (testTask.xTokensData.size() > 1){
- XTokenName = TestTask.XTokensDataTokens[1];
+ xTokenName = testTask.xTokensDataTokens[1];
}
- ASSERT_EQ("Meep", XTokenData);
- ASSERT_EQ("X-EXAMPLE1;ANIMAL=NOPE", XTokenName);
+ ASSERT_EQ("Meep", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1;ANIMAL=NOPE", xTokenName);
// Get the third X-EXAMPLE1 token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestTask.XTokensData.size() > 2){
+ if (testTask.xTokensData.size() > 2){
- XTokenData = TestTask.XTokensData[2];
+ xTokenData = testTask.xTokensData[2];
}
- if (TestTask.XTokensData.size() > 2){
+ if (testTask.xTokensData.size() > 2){
- XTokenName = TestTask.XTokensDataTokens[2];
+ xTokenName = testTask.xTokensDataTokens[2];
}
- ASSERT_EQ("Meow", XTokenData);
- ASSERT_EQ("X-EXAMPLE1;ANIMAL=CAT", XTokenName);
+ ASSERT_EQ("Meow", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1;ANIMAL=CAT", xTokenName);
// Get the first X-EXAMPLE2 token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestTask.XTokensData.size() > 3){
+ if (testTask.xTokensData.size() > 3){
- XTokenData = TestTask.XTokensData[3];
+ xTokenData = testTask.xTokensData[3];
}
- if (TestTask.XTokensData.size() > 3){
+ if (testTask.xTokensData.size() > 3){
- XTokenName = TestTask.XTokensDataTokens[3];
+ xTokenName = testTask.xTokensDataTokens[3];
}
- ASSERT_EQ("Dish", XTokenData);
- ASSERT_EQ("X-EXAMPLE2", XTokenName);
+ ASSERT_EQ("Dish", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2", xTokenName);
// Get the second X-EXAMPLE2 token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestTask.XTokensData.size() > 4){
+ if (testTask.xTokensData.size() > 4){
- XTokenData = TestTask.XTokensData[4];
+ xTokenData = testTask.xTokensData[4];
}
- if (TestTask.XTokensData.size() > 4){
+ if (testTask.xTokensData.size() > 4){
- XTokenName = TestTask.XTokensDataTokens[4];
+ xTokenName = testTask.xTokensDataTokens[4];
}
- ASSERT_EQ("Fork", XTokenData);
- ASSERT_EQ("X-EXAMPLE2;OBJECT=KITCHEN", XTokenName);
+ ASSERT_EQ("Fork", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2;OBJECT=KITCHEN", xTokenName);
// Get the third X-EXAMPLE2 token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestTask.XTokensData.size() > 5){
+ if (testTask.xTokensData.size() > 5){
- XTokenData = TestTask.XTokensData[5];
+ xTokenData = testTask.xTokensData[5];
}
- if (TestTask.XTokensData.size() > 5){
+ if (testTask.xTokensData.size() > 5){
- XTokenName = TestTask.XTokensDataTokens[5];
+ xTokenName = testTask.xTokensDataTokens[5];
}
- ASSERT_EQ("Table", XTokenData);
- ASSERT_EQ("X-EXAMPLE2;OBJECT=LIVINGROOM", XTokenName);
+ ASSERT_EQ("Table", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2;OBJECT=LIVINGROOM", xTokenName);
// Get the X-STATUS token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestTask.XTokensData.size() > 6){
+ if (testTask.xTokensData.size() > 6){
- XTokenData = TestTask.XTokensData[6];
+ xTokenData = testTask.xTokensData[6];
}
- if (TestTask.XTokensData.size() > 6){
+ if (testTask.xTokensData.size() > 6){
- XTokenName = TestTask.XTokensDataTokens[6];
+ xTokenName = testTask.xTokensDataTokens[6];
}
- ASSERT_EQ("Idle", XTokenData);
- ASSERT_EQ("X-STATUS;HOLIDAY=YES", XTokenName);
+ ASSERT_EQ("Idle", xTokenData);
+ ASSERT_EQ("X-STATUS;HOLIDAY=YES", xTokenName);
// Get the X-TRANSPORT token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestTask.XTokensData.size() > 7){
+ if (testTask.xTokensData.size() > 7){
- XTokenData = TestTask.XTokensData[7];
+ xTokenData = testTask.xTokensData[7];
}
- if (TestTask.XTokensData.size() > 7){
+ if (testTask.xTokensData.size() > 7){
- XTokenName = TestTask.XTokensDataTokens[7];
+ xTokenName = testTask.xTokensDataTokens[7];
}
- ASSERT_EQ("Private Hire", XTokenData);
- ASSERT_EQ("X-TRANSPORT;PUBLIC=NO", XTokenName);
+ ASSERT_EQ("Private Hire", xTokenData);
+ ASSERT_EQ("X-TRANSPORT;PUBLIC=NO", xTokenName);
// Get the X-PHANTOM-STATUS token.
- XTokenName.clear();
- XTokenData.clear();
+ xTokenName.clear();
+ xTokenData.clear();
- if (TestTask.XTokensData.size() > 8){
+ if (testTask.xTokensData.size() > 8){
- XTokenData = TestTask.XTokensData[8];
+ xTokenData = testTask.xTokensData[8];
}
- if (TestTask.XTokensData.size() > 8){
+ if (testTask.xTokensData.size() > 8){
- XTokenName = TestTask.XTokensDataTokens[8];
+ xTokenName = testTask.xTokensDataTokens[8];
}
- ASSERT_EQ("None", XTokenData);
- ASSERT_EQ("X-PHANTOM-STATUS;HELP=NONE", XTokenName);
+ ASSERT_EQ("None", xTokenData);
+ ASSERT_EQ("X-PHANTOM-STATUS;HELP=NONE", xTokenName);
}
TEST(iCalendarTask, AlarmTests){
- CalendarTaskObject TestTask;
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestTask.LoadFile("iCalendarTask-Load2.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestTask.ValidBaseObject());
+ CalendarTaskObject testTask;
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTask.LoadFile("iCalendarTask-Load2.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testTask.ValidBaseObject());
// Tests for the first VALARM property.
std::string RepeatData;
std::string RepeatTokens;
- std::string XTokenData;
- std::string XTokenName;
+ std::string xTokenData;
+ std::string xTokenName;
- if (TestTask.CalendarAlarmData.size() > 0){
+ if (testTask.calendarAlarmData.size() > 0){
- ActionData = TestTask.CalendarAlarmData[0].AlarmAction;
- ActionDataTokens = TestTask.CalendarAlarmData[0].AlarmActionTokens;
+ ActionData = testTask.calendarAlarmData[0].AlarmAction;
+ ActionDataTokens = testTask.calendarAlarmData[0].AlarmActionTokens;
- TriggerData = TestTask.CalendarAlarmData[0].TriggerData;
- TriggerRelated = TestTask.CalendarAlarmData[0].TriggerRelated;
- TriggerValue = TestTask.CalendarAlarmData[0].TriggerValue;
- TriggerTokens = TestTask.CalendarAlarmData[0].TriggerTokens;
+ TriggerData = testTask.calendarAlarmData[0].TriggerData;
+ TriggerRelated = testTask.calendarAlarmData[0].TriggerRelated;
+ TriggerValue = testTask.calendarAlarmData[0].TriggerValue;
+ TriggerTokens = testTask.calendarAlarmData[0].TriggerTokens;
- DurationData = TestTask.CalendarAlarmData[0].DurationData;
- DurationTokens = TestTask.CalendarAlarmData[0].DurationTokens;
+ DurationData = testTask.calendarAlarmData[0].DurationData;
+ DurationTokens = testTask.calendarAlarmData[0].DurationTokens;
- RepeatData = TestTask.CalendarAlarmData[0].RepeatData;
- RepeatTokens = TestTask.CalendarAlarmData[0].RepeatTokens;
+ RepeatData = testTask.calendarAlarmData[0].RepeatData;
+ RepeatTokens = testTask.calendarAlarmData[0].RepeatTokens;
}
// Tests for ATTACH. First ATTACH property.
- std::string AttachData;
- std::string AttachDataFormatType;
- std::string AttachDataValue;
- std::string AttachDataEncoding;
- std::string AttachDataTokens;
+ std::string attachData;
+ std::string attachDataFormatType;
+ std::string attachDataValue;
+ std::string attachDataEncoding;
+ std::string attachDataTokens;
- if (TestTask.CalendarAlarmData[0].AttachList.begin() != TestTask.CalendarAlarmData[0].AttachList.end()){
+ if (testTask.calendarAlarmData[0].attachList.begin() != testTask.calendarAlarmData[0].attachList.end()){
- AttachData = TestTask.AttachList[0];
+ attachData = testTask.attachList[0];
}
- if (TestTask.CalendarAlarmData[0].AttachListFormatType.begin() != TestTask.CalendarAlarmData[0].AttachListFormatType.end()){
+ if (testTask.calendarAlarmData[0].attachListFormatType.begin() != testTask.calendarAlarmData[0].attachListFormatType.end()){
- AttachDataFormatType = TestTask.AttachListFormatType[0];
+ attachDataFormatType = testTask.attachListFormatType[0];
}
- ASSERT_EQ("http://www.example.com/", AttachData);
- ASSERT_EQ("application/internet-shortcut", AttachDataFormatType);
+ ASSERT_EQ("http://www.example.com/", attachData);
+ ASSERT_EQ("application/internet-shortcut", attachDataFormatType);
// Second ATTACH property.
- AttachData.clear();
- AttachDataFormatType.clear();
- AttachDataValue.clear();
- AttachDataEncoding.clear();
+ attachData.clear();
+ attachDataFormatType.clear();
+ attachDataValue.clear();
+ attachDataEncoding.clear();
- if (TestTask.CalendarAlarmData[0].AttachList.size() > 1){
+ if (testTask.calendarAlarmData[0].attachList.size() > 1){
- AttachData = TestTask.CalendarAlarmData[0].AttachList[1];
+ attachData = testTask.calendarAlarmData[0].attachList[1];
}
- if (TestTask.CalendarAlarmData[0].AttachListFormatType.size() > 1){
+ if (testTask.calendarAlarmData[0].attachListFormatType.size() > 1){
- AttachDataFormatType = TestTask.CalendarAlarmData[0].AttachListFormatType[1];
+ attachDataFormatType = testTask.calendarAlarmData[0].attachListFormatType[1];
}
- ASSERT_EQ("http://www.example.com/page2.html", AttachData);
- ASSERT_EQ("application/internet-shortcut", AttachDataFormatType);
+ ASSERT_EQ("http://www.example.com/page2.html", attachData);
+ ASSERT_EQ("application/internet-shortcut", attachDataFormatType);
// Third ATTACH property.
- AttachData.clear();
- AttachDataFormatType.clear();
- AttachDataValue.clear();
- AttachDataEncoding.clear();
- AttachDataTokens.clear();
+ attachData.clear();
+ attachDataFormatType.clear();
+ attachDataValue.clear();
+ attachDataEncoding.clear();
+ attachDataTokens.clear();
- if (TestTask.CalendarAlarmData[0].AttachList.size() > 2){
+ if (testTask.calendarAlarmData[0].attachList.size() > 2){
- AttachData = TestTask.CalendarAlarmData[0].AttachList[2];
+ attachData = testTask.calendarAlarmData[0].attachList[2];
}
- if (TestTask.CalendarAlarmData[0].AttachListFormatType.size() > 2){
+ if (testTask.calendarAlarmData[0].attachListFormatType.size() > 2){
- AttachDataFormatType = TestTask.CalendarAlarmData[0].AttachListFormatType[2];
+ attachDataFormatType = testTask.calendarAlarmData[0].attachListFormatType[2];
}
- if (TestTask.CalendarAlarmData[0].AttachListValue.size() > 2){
+ if (testTask.calendarAlarmData[0].attachListValue.size() > 2){
- AttachDataValue = TestTask.CalendarAlarmData[0].AttachListValue[2];
+ attachDataValue = testTask.calendarAlarmData[0].attachListValue[2];
}
- if (TestTask.CalendarAlarmData[0].AttachListFormatType.size() > 2){
+ if (testTask.calendarAlarmData[0].attachListFormatType.size() > 2){
- AttachDataEncoding = TestTask.CalendarAlarmData[0].AttachListEncoding[2];
+ attachDataEncoding = testTask.calendarAlarmData[0].attachListEncoding[2];
}
- if (TestTask.CalendarAlarmData[0].AttachListTokens.size() > 2){
+ if (testTask.calendarAlarmData[0].attachListTokens.size() > 2){
- AttachDataTokens = TestTask.CalendarAlarmData[0].AttachListTokens[2];
+ attachDataTokens = testTask.calendarAlarmData[0].attachListTokens[2];
}
- ASSERT_EQ("VGhpcyBpcyBhbiBleGFtcGxlIGZpbGU=", AttachData);
- ASSERT_EQ("text/plain", AttachDataFormatType);
- ASSERT_EQ("BASE64", AttachDataEncoding);
- ASSERT_EQ("BINARY", AttachDataValue);
- ASSERT_EQ("STUPID=EXAMPLE", AttachDataTokens);
+ ASSERT_EQ("VGhpcyBpcyBhbiBleGFtcGxlIGZpbGU=", attachData);
+ ASSERT_EQ("text/plain", attachDataFormatType);
+ ASSERT_EQ("BASE64", attachDataEncoding);
+ ASSERT_EQ("BINARY", attachDataValue);
+ ASSERT_EQ("STUPID=EXAMPLE", attachDataTokens);
// Test the first X-Token.
- if (TestTask.CalendarAlarmData[0].XTokensData.size() > 0){
+ if (testTask.calendarAlarmData[0].xTokensData.size() > 0){
- XTokenData = TestTask.CalendarAlarmData[0].XTokensData[0];
- XTokenName = TestTask.CalendarAlarmData[0].XTokensDataTokens[0];
+ xTokenData = testTask.calendarAlarmData[0].xTokensData[0];
+ xTokenName = testTask.calendarAlarmData[0].xTokensDataTokens[0];
}
- ASSERT_EQ("Example Data 1", XTokenData);
- ASSERT_EQ("X-EXAMPLE1;YAY=YES", XTokenName);
+ ASSERT_EQ("Example Data 1", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1;YAY=YES", xTokenName);
// Test the second X-Token.
- XTokenData.clear();
- XTokenName.clear();
+ xTokenData.clear();
+ xTokenName.clear();
- if (TestTask.CalendarAlarmData[0].XTokensData.size() > 1){
+ if (testTask.calendarAlarmData[0].xTokensData.size() > 1){
- XTokenData = TestTask.CalendarAlarmData[0].XTokensData[1];
- XTokenName = TestTask.CalendarAlarmData[0].XTokensDataTokens[1];
+ xTokenData = testTask.calendarAlarmData[0].xTokensData[1];
+ xTokenName = testTask.calendarAlarmData[0].xTokensDataTokens[1];
}
- ASSERT_EQ("Example Data 2", XTokenData);
- ASSERT_EQ("X-EXAMPLE2;NOPE=YEP", XTokenName);
+ ASSERT_EQ("Example Data 2", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2;NOPE=YEP", xTokenName);
// Test the third X-Token.
- XTokenData.clear();
- XTokenName.clear();
+ xTokenData.clear();
+ xTokenName.clear();
- if (TestTask.CalendarAlarmData[0].XTokensData.size() > 2){
+ if (testTask.calendarAlarmData[0].xTokensData.size() > 2){
- XTokenData = TestTask.CalendarAlarmData[0].XTokensData[2];
- XTokenName = TestTask.CalendarAlarmData[0].XTokensDataTokens[2];
+ xTokenData = testTask.calendarAlarmData[0].xTokensData[2];
+ xTokenName = testTask.calendarAlarmData[0].xTokensDataTokens[2];
}
- ASSERT_EQ("Example Data 3", XTokenData);
- ASSERT_EQ("X-EXAMPLE3;WORLD=NO", XTokenName);
+ ASSERT_EQ("Example Data 3", xTokenData);
+ ASSERT_EQ("X-EXAMPLE3;WORLD=NO", xTokenName);
// Tests for the second VALARM property.
RepeatData.clear();
RepeatTokens.clear();
- XTokenData.clear();
- XTokenName.clear();
+ xTokenData.clear();
+ xTokenName.clear();
- string DescriptionData;
- string DescriptionAltRep;
- string DescriptionLanguage;
- string DescriptionTokens;
+ string descriptionData;
+ string descriptionAltRep;
+ string descriptionLanguage;
+ string descriptionTokens;
- if (TestTask.CalendarAlarmData.size() > 1){
+ if (testTask.calendarAlarmData.size() > 1){
- ActionData = TestTask.CalendarAlarmData[1].AlarmAction;
- ActionDataTokens = TestTask.CalendarAlarmData[1].AlarmActionTokens;
+ ActionData = testTask.calendarAlarmData[1].AlarmAction;
+ ActionDataTokens = testTask.calendarAlarmData[1].AlarmActionTokens;
- TriggerData = TestTask.CalendarAlarmData[1].TriggerData;
- TriggerRelated = TestTask.CalendarAlarmData[1].TriggerRelated;
- TriggerValue = TestTask.CalendarAlarmData[1].TriggerValue;
- TriggerTokens = TestTask.CalendarAlarmData[1].TriggerTokens;
+ TriggerData = testTask.calendarAlarmData[1].TriggerData;
+ TriggerRelated = testTask.calendarAlarmData[1].TriggerRelated;
+ TriggerValue = testTask.calendarAlarmData[1].TriggerValue;
+ TriggerTokens = testTask.calendarAlarmData[1].TriggerTokens;
- DurationData = TestTask.CalendarAlarmData[1].DurationData;
- DurationTokens = TestTask.CalendarAlarmData[1].DurationTokens;
+ DurationData = testTask.calendarAlarmData[1].DurationData;
+ DurationTokens = testTask.calendarAlarmData[1].DurationTokens;
- RepeatData = TestTask.CalendarAlarmData[1].RepeatData;
- RepeatTokens = TestTask.CalendarAlarmData[1].RepeatTokens;
+ RepeatData = testTask.calendarAlarmData[1].RepeatData;
+ RepeatTokens = testTask.calendarAlarmData[1].RepeatTokens;
- DescriptionData = TestTask.CalendarAlarmData[1].DescriptionData;
- DescriptionAltRep = TestTask.CalendarAlarmData[1].DescriptionAltRep;
- DescriptionLanguage = TestTask.CalendarAlarmData[1].DescriptionLanguage;
- DescriptionTokens = TestTask.CalendarAlarmData[1].DescriptionTokens;
+ descriptionData = testTask.calendarAlarmData[1].descriptionData;
+ descriptionAltRep = testTask.calendarAlarmData[1].descriptionAltRep;
+ descriptionLanguage = testTask.calendarAlarmData[1].descriptionLanguage;
+ descriptionTokens = testTask.calendarAlarmData[1].descriptionTokens;
}
ASSERT_EQ("PT3M", RepeatData);
ASSERT_EQ("SLEEP=ALWAYS", RepeatTokens);
- ASSERT_EQ("This is the second alarm.", DescriptionData);
- ASSERT_EQ("null:nodata", DescriptionAltRep);
- ASSERT_EQ("kw", DescriptionLanguage);
- ASSERT_EQ("TERRIBLE=TOKEN", DescriptionTokens);
+ ASSERT_EQ("This is the second alarm.", descriptionData);
+ ASSERT_EQ("null:nodata", descriptionAltRep);
+ ASSERT_EQ("kw", descriptionLanguage);
+ ASSERT_EQ("TERRIBLE=TOKEN", descriptionTokens);
// Test the first X-Token.
- if (TestTask.CalendarAlarmData[1].XTokensData.size() > 0){
+ if (testTask.calendarAlarmData[1].xTokensData.size() > 0){
- XTokenData = TestTask.CalendarAlarmData[1].XTokensData[0];
- XTokenName = TestTask.CalendarAlarmData[1].XTokensDataTokens[0];
+ xTokenData = testTask.calendarAlarmData[1].xTokensData[0];
+ xTokenName = testTask.calendarAlarmData[1].xTokensDataTokens[0];
}
- ASSERT_EQ("Example Data 1", XTokenData);
- ASSERT_EQ("X-EXAMPLE1;YAY=YES", XTokenName);
+ ASSERT_EQ("Example Data 1", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1;YAY=YES", xTokenName);
// Test the second X-Token.
- XTokenData.clear();
- XTokenName.clear();
+ xTokenData.clear();
+ xTokenName.clear();
- if (TestTask.CalendarAlarmData[1].XTokensData.size() > 1){
+ if (testTask.calendarAlarmData[1].xTokensData.size() > 1){
- XTokenData = TestTask.CalendarAlarmData[1].XTokensData[1];
- XTokenName = TestTask.CalendarAlarmData[1].XTokensDataTokens[1];
+ xTokenData = testTask.calendarAlarmData[1].xTokensData[1];
+ xTokenName = testTask.calendarAlarmData[1].xTokensDataTokens[1];
}
- ASSERT_EQ("Example Data 2", XTokenData);
- ASSERT_EQ("X-EXAMPLE2;NOPE=YEP", XTokenName);
+ ASSERT_EQ("Example Data 2", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2;NOPE=YEP", xTokenName);
// Test the third X-Token.
- XTokenData.clear();
- XTokenName.clear();
+ xTokenData.clear();
+ xTokenName.clear();
- if (TestTask.CalendarAlarmData[1].XTokensData.size() > 2){
+ if (testTask.calendarAlarmData[1].xTokensData.size() > 2){
- XTokenData = TestTask.CalendarAlarmData[1].XTokensData[2];
- XTokenName = TestTask.CalendarAlarmData[1].XTokensDataTokens[2];
+ xTokenData = testTask.calendarAlarmData[1].xTokensData[2];
+ xTokenName = testTask.calendarAlarmData[1].xTokensDataTokens[2];
}
- ASSERT_EQ("Example Data 3", XTokenData);
- ASSERT_EQ("X-EXAMPLE3;WORLD=NO", XTokenName);
+ ASSERT_EQ("Example Data 3", xTokenData);
+ ASSERT_EQ("X-EXAMPLE3;WORLD=NO", xTokenName);
// Tests for the third VALARM property.
RepeatData.clear();
RepeatTokens.clear();
- XTokenData.clear();
- XTokenName.clear();
+ xTokenData.clear();
+ xTokenName.clear();
- DescriptionData.clear();
- DescriptionAltRep.clear();
- DescriptionLanguage.clear();
- DescriptionTokens.clear();
+ descriptionData.clear();
+ descriptionAltRep.clear();
+ descriptionLanguage.clear();
+ descriptionTokens.clear();
string SummaryData;
string SummaryAltRep;
string SummaryLanguage;
string SummaryTokens;
- string AttendeeDataMember;
- string AttendeeDataDelegatedFrom;
- string AttendeeDataDelegatedTo;
- string AttendeeDataRole;
- string AttendeeDataRSVP;
- string AttendeeDataDirectoryEntry;
- string AttendeeDataSentBy;
- string AttendeeDataCommonName;
- string AttendeeDataCalendarUserType;
- string AttendeeDataParticipationStatus;
- string AttendeeDataLanguage;
- string AttendeeDataTokens;
- string AttendeeData;
+ string attendeeDataMember;
+ string attendeeDataDelegatedFrom;
+ string attendeeDataDelegatedTo;
+ string attendeeDataRole;
+ string attendeeDataRSVP;
+ string attendeeDataDirectoryEntry;
+ string attendeeDataSentBy;
+ string attendeeDataCommonName;
+ string attendeeDataCalendarUserType;
+ string attendeeDataParticipationStatus;
+ string attendeeDataLanguage;
+ string attendeeDataTokens;
+ string attendeeData;
- AttachData.clear();
- AttachDataFormatType.clear();
- AttachDataValue.clear();
- AttachDataEncoding.clear();
- AttachDataTokens.clear();
+ attachData.clear();
+ attachDataFormatType.clear();
+ attachDataValue.clear();
+ attachDataEncoding.clear();
+ attachDataTokens.clear();
- if (TestTask.CalendarAlarmData.size() > 2){
+ if (testTask.calendarAlarmData.size() > 2){
- ActionData = TestTask.CalendarAlarmData[2].AlarmAction;
- ActionDataTokens = TestTask.CalendarAlarmData[2].AlarmActionTokens;
+ ActionData = testTask.calendarAlarmData[2].AlarmAction;
+ ActionDataTokens = testTask.calendarAlarmData[2].AlarmActionTokens;
- TriggerData = TestTask.CalendarAlarmData[2].TriggerData;
- TriggerRelated = TestTask.CalendarAlarmData[2].TriggerRelated;
- TriggerValue = TestTask.CalendarAlarmData[2].TriggerValue;
- TriggerTokens = TestTask.CalendarAlarmData[2].TriggerTokens;
+ TriggerData = testTask.calendarAlarmData[2].TriggerData;
+ TriggerRelated = testTask.calendarAlarmData[2].TriggerRelated;
+ TriggerValue = testTask.calendarAlarmData[2].TriggerValue;
+ TriggerTokens = testTask.calendarAlarmData[2].TriggerTokens;
- DurationData = TestTask.CalendarAlarmData[2].DurationData;
- DurationTokens = TestTask.CalendarAlarmData[2].DurationTokens;
+ DurationData = testTask.calendarAlarmData[2].DurationData;
+ DurationTokens = testTask.calendarAlarmData[2].DurationTokens;
- RepeatData = TestTask.CalendarAlarmData[2].RepeatData;
- RepeatTokens = TestTask.CalendarAlarmData[2].RepeatTokens;
+ RepeatData = testTask.calendarAlarmData[2].RepeatData;
+ RepeatTokens = testTask.calendarAlarmData[2].RepeatTokens;
- DescriptionData = TestTask.CalendarAlarmData[2].DescriptionData;
- DescriptionAltRep = TestTask.CalendarAlarmData[2].DescriptionAltRep;
- DescriptionLanguage = TestTask.CalendarAlarmData[2].DescriptionLanguage;
- DescriptionTokens = TestTask.CalendarAlarmData[2].DescriptionTokens;
+ descriptionData = testTask.calendarAlarmData[2].descriptionData;
+ descriptionAltRep = testTask.calendarAlarmData[2].descriptionAltRep;
+ descriptionLanguage = testTask.calendarAlarmData[2].descriptionLanguage;
+ descriptionTokens = testTask.calendarAlarmData[2].descriptionTokens;
- SummaryData = TestTask.CalendarAlarmData[2].SummaryData;
- SummaryAltRep = TestTask.CalendarAlarmData[2].SummaryAltRep;
- SummaryLanguage = TestTask.CalendarAlarmData[2].SummaryLanguage;
- SummaryTokens = TestTask.CalendarAlarmData[2].SummaryTokens;
+ SummaryData = testTask.calendarAlarmData[2].SummaryData;
+ SummaryAltRep = testTask.calendarAlarmData[2].SummaryAltRep;
+ SummaryLanguage = testTask.calendarAlarmData[2].SummaryLanguage;
+ SummaryTokens = testTask.calendarAlarmData[2].SummaryTokens;
}
ASSERT_EQ("PT3M", RepeatData);
ASSERT_EQ("SLEEP=ALWAYS", RepeatTokens);
- ASSERT_EQ("This is the third alarm.", DescriptionData);
- ASSERT_EQ("null:nodata", DescriptionAltRep);
- ASSERT_EQ("kw", DescriptionLanguage);
- ASSERT_EQ("TERRIBLE=TOKEN", DescriptionTokens);
+ ASSERT_EQ("This is the third alarm.", descriptionData);
+ ASSERT_EQ("null:nodata", descriptionAltRep);
+ ASSERT_EQ("kw", descriptionLanguage);
+ ASSERT_EQ("TERRIBLE=TOKEN", descriptionTokens);
ASSERT_EQ("This is the summary of the third alarm.", SummaryData);
ASSERT_EQ("null:nodata", SummaryAltRep);
// Tests for ATTENDEE. First ATTENDEE property.
- if (TestTask.CalendarAlarmData[2].AttendeeList.begin() != TestTask.CalendarAlarmData[2].AttendeeList.end()){
+ if (testTask.calendarAlarmData[2].attendeeList.begin() != testTask.calendarAlarmData[2].attendeeList.end()){
- AttendeeData = TestTask.CalendarAlarmData[2].AttendeeList[0];
+ attendeeData = testTask.calendarAlarmData[2].attendeeList[0];
}
- ASSERT_EQ("Attendee One", AttendeeData);
+ ASSERT_EQ("Attendee One", attendeeData);
// Second ATTENDEE property.
- AttendeeData.clear();
+ attendeeData.clear();
- if (TestTask.CalendarAlarmData[2].AttendeeList.size() > 1){
+ if (testTask.calendarAlarmData[2].attendeeList.size() > 1){
- AttendeeData = TestTask.CalendarAlarmData[2].AttendeeList[1];
+ attendeeData = testTask.calendarAlarmData[2].attendeeList[1];
}
- if (TestTask.CalendarAlarmData[2].AttendeeList.size() > 1){
+ if (testTask.calendarAlarmData[2].attendeeList.size() > 1){
- AttendeeDataDelegatedFrom = TestTask.CalendarAlarmData[2].AttendeeListDelegatedFrom[1];
+ attendeeDataDelegatedFrom = testTask.calendarAlarmData[2].attendeeListDelegatedFrom[1];
}
- if (TestTask.CalendarAlarmData[2].AttendeeList.size() > 1){
+ if (testTask.calendarAlarmData[2].attendeeList.size() > 1){
- AttendeeDataDelegatedTo = TestTask.CalendarAlarmData[2].AttendeeListDelegatedTo[1];
+ attendeeDataDelegatedTo = testTask.calendarAlarmData[2].attendeeListDelegatedTo[1];
}
- if (TestTask.CalendarAlarmData[2].AttendeeList.size() > 1){
+ if (testTask.calendarAlarmData[2].attendeeList.size() > 1){
- AttendeeDataRole = TestTask.CalendarAlarmData[2].AttendeeListRole[1];
+ attendeeDataRole = testTask.calendarAlarmData[2].attendeeListRole[1];
}
- if (TestTask.CalendarAlarmData[2].AttendeeList.size() > 1){
+ if (testTask.calendarAlarmData[2].attendeeList.size() > 1){
- AttendeeDataRSVP = TestTask.CalendarAlarmData[2].AttendeeListRSVP[1];
+ attendeeDataRSVP = testTask.calendarAlarmData[2].attendeeListRSVP[1];
}
- ASSERT_EQ("Attendee Two", AttendeeData);
- ASSERT_EQ("mailto:delegated.from@example.com", AttendeeDataDelegatedFrom);
- ASSERT_EQ("mailto:delegated.to@example.com", AttendeeDataDelegatedTo);
- ASSERT_EQ("CHAIR", AttendeeDataRole);
- ASSERT_EQ("TRUE", AttendeeDataRSVP);
+ ASSERT_EQ("Attendee Two", attendeeData);
+ ASSERT_EQ("mailto:delegated.from@example.com", attendeeDataDelegatedFrom);
+ ASSERT_EQ("mailto:delegated.to@example.com", attendeeDataDelegatedTo);
+ ASSERT_EQ("CHAIR", attendeeDataRole);
+ ASSERT_EQ("TRUE", attendeeDataRSVP);
// Third ATTENDEE property.
- AttendeeData.clear();
+ attendeeData.clear();
- if (TestTask.CalendarAlarmData[2].AttendeeList.size() > 2){
+ if (testTask.calendarAlarmData[2].attendeeList.size() > 2){
- AttendeeData = TestTask.CalendarAlarmData[2].AttendeeList[2];
+ attendeeData = testTask.calendarAlarmData[2].attendeeList[2];
}
- if (TestTask.CalendarAlarmData[2].AttendeeList.size() > 2){
+ if (testTask.calendarAlarmData[2].attendeeList.size() > 2){
- AttendeeDataDirectoryEntry = TestTask.CalendarAlarmData[2].AttendeeListDirectoryEntry[2];
+ attendeeDataDirectoryEntry = testTask.calendarAlarmData[2].attendeeListDirectoryEntry[2];
}
- if (TestTask.CalendarAlarmData[2].AttendeeList.size() > 2){
+ if (testTask.calendarAlarmData[2].attendeeList.size() > 2){
- AttendeeDataSentBy = TestTask.CalendarAlarmData[2].AttendeeListSentBy[2];
+ attendeeDataSentBy = testTask.calendarAlarmData[2].attendeeListSentBy[2];
}
- if (TestTask.CalendarAlarmData[2].AttendeeList.size() > 2){
+ if (testTask.calendarAlarmData[2].attendeeList.size() > 2){
- AttendeeDataCommonName = TestTask.CalendarAlarmData[2].AttendeeListCommonName[2];
+ attendeeDataCommonName = testTask.calendarAlarmData[2].attendeeListCommonName[2];
}
- if (TestTask.CalendarAlarmData[2].AttendeeList.size() > 2){
+ if (testTask.calendarAlarmData[2].attendeeList.size() > 2){
- AttendeeDataCalendarUserType = TestTask.CalendarAlarmData[2].AttendeeListCalendarUserType[2];
+ attendeeDataCalendarUserType = testTask.calendarAlarmData[2].attendeeListCalendarUserType[2];
}
- if (TestTask.CalendarAlarmData[2].AttendeeList.size() > 2){
+ if (testTask.calendarAlarmData[2].attendeeList.size() > 2){
- AttendeeDataParticipationStatus = TestTask.CalendarAlarmData[2].AttendeeListParticipationStatus[2];
+ attendeeDataParticipationStatus = testTask.calendarAlarmData[2].attendeeListParticipationStatus[2];
}
- if (TestTask.CalendarAlarmData[2].AttendeeList.size() > 2){
+ if (testTask.calendarAlarmData[2].attendeeList.size() > 2){
- AttendeeDataLanguage = TestTask.CalendarAlarmData[2].AttendeeListLanguage[2];
+ attendeeDataLanguage = testTask.calendarAlarmData[2].attendeeListLanguage[2];
}
- if (TestTask.CalendarAlarmData[2].AttendeeList.size() > 2){
+ if (testTask.calendarAlarmData[2].attendeeList.size() > 2){
- AttendeeDataTokens = TestTask.CalendarAlarmData[2].AttendeeListTokens[2];
+ attendeeDataTokens = testTask.calendarAlarmData[2].attendeeListTokens[2];
}
- ASSERT_EQ("Attendee Three", AttendeeData);
- ASSERT_EQ("null:nodata", AttendeeDataDirectoryEntry);
- ASSERT_EQ("mailto:sent.by@example.com", AttendeeDataSentBy);
- ASSERT_EQ("Attendee The Third", AttendeeDataCommonName);
- ASSERT_EQ("INDIVIDUAL", AttendeeDataCalendarUserType);
- ASSERT_EQ("ACCEPTED", AttendeeDataParticipationStatus);
- ASSERT_EQ("kw", AttendeeDataLanguage);
- ASSERT_EQ("EXAMPLE=DATA", AttendeeDataTokens);
+ ASSERT_EQ("Attendee Three", attendeeData);
+ ASSERT_EQ("null:nodata", attendeeDataDirectoryEntry);
+ ASSERT_EQ("mailto:sent.by@example.com", attendeeDataSentBy);
+ ASSERT_EQ("Attendee The Third", attendeeDataCommonName);
+ ASSERT_EQ("INDIVIDUAL", attendeeDataCalendarUserType);
+ ASSERT_EQ("ACCEPTED", attendeeDataParticipationStatus);
+ ASSERT_EQ("kw", attendeeDataLanguage);
+ ASSERT_EQ("EXAMPLE=DATA", attendeeDataTokens);
// Tests for ATTACH. First ATTACH property.
- if (TestTask.CalendarAlarmData[2].AttachList.begin() != TestTask.CalendarAlarmData[2].AttachList.end()){
+ if (testTask.calendarAlarmData[2].attachList.begin() != testTask.calendarAlarmData[2].attachList.end()){
- AttachData = TestTask.CalendarAlarmData[2].AttachList[0];
+ attachData = testTask.calendarAlarmData[2].attachList[0];
}
- if (TestTask.CalendarAlarmData[2].AttachListFormatType.begin() != TestTask.CalendarAlarmData[2].AttachListFormatType.end()){
+ if (testTask.calendarAlarmData[2].attachListFormatType.begin() != testTask.calendarAlarmData[2].attachListFormatType.end()){
- AttachDataFormatType = TestTask.CalendarAlarmData[2].AttachListFormatType[0];
+ attachDataFormatType = testTask.calendarAlarmData[2].attachListFormatType[0];
}
- ASSERT_EQ("http://www.example.com/", AttachData);
- ASSERT_EQ("application/internet-shortcut", AttachDataFormatType);
+ ASSERT_EQ("http://www.example.com/", attachData);
+ ASSERT_EQ("application/internet-shortcut", attachDataFormatType);
// Second ATTACH property.
- AttachData.clear();
- AttachDataFormatType.clear();
- AttachDataValue.clear();
- AttachDataEncoding.clear();
+ attachData.clear();
+ attachDataFormatType.clear();
+ attachDataValue.clear();
+ attachDataEncoding.clear();
- if (TestTask.CalendarAlarmData[2].AttachList.size() > 1){
+ if (testTask.calendarAlarmData[2].attachList.size() > 1){
- AttachData = TestTask.CalendarAlarmData[2].AttachList[1];
+ attachData = testTask.calendarAlarmData[2].attachList[1];
}
- if (TestTask.CalendarAlarmData[2].AttachListFormatType.size() > 1){
+ if (testTask.calendarAlarmData[2].attachListFormatType.size() > 1){
- AttachDataFormatType = TestTask.CalendarAlarmData[2].AttachListFormatType[1];
+ attachDataFormatType = testTask.calendarAlarmData[2].attachListFormatType[1];
}
- ASSERT_EQ("http://www.example.com/page2.html", AttachData);
- ASSERT_EQ("application/internet-shortcut", AttachDataFormatType);
+ ASSERT_EQ("http://www.example.com/page2.html", attachData);
+ ASSERT_EQ("application/internet-shortcut", attachDataFormatType);
// Third ATTACH property.
- AttachData.clear();
- AttachDataFormatType.clear();
- AttachDataValue.clear();
- AttachDataEncoding.clear();
- AttachDataTokens.clear();
+ attachData.clear();
+ attachDataFormatType.clear();
+ attachDataValue.clear();
+ attachDataEncoding.clear();
+ attachDataTokens.clear();
- if (TestTask.CalendarAlarmData[2].AttachList.size() > 2){
+ if (testTask.calendarAlarmData[2].attachList.size() > 2){
- AttachData = TestTask.CalendarAlarmData[2].AttachList[2];
+ attachData = testTask.calendarAlarmData[2].attachList[2];
}
- if (TestTask.CalendarAlarmData[2].AttachListFormatType.size() > 2){
+ if (testTask.calendarAlarmData[2].attachListFormatType.size() > 2){
- AttachDataFormatType = TestTask.CalendarAlarmData[2].AttachListFormatType[2];
+ attachDataFormatType = testTask.calendarAlarmData[2].attachListFormatType[2];
}
- if (TestTask.CalendarAlarmData[2].AttachListValue.size() > 2){
+ if (testTask.calendarAlarmData[2].attachListValue.size() > 2){
- AttachDataValue = TestTask.CalendarAlarmData[2].AttachListValue[2];
+ attachDataValue = testTask.calendarAlarmData[2].attachListValue[2];
}
- if (TestTask.CalendarAlarmData[2].AttachListFormatType.size() > 2){
+ if (testTask.calendarAlarmData[2].attachListFormatType.size() > 2){
- AttachDataEncoding = TestTask.CalendarAlarmData[2].AttachListEncoding[2];
+ attachDataEncoding = testTask.calendarAlarmData[2].attachListEncoding[2];
}
- if (TestTask.CalendarAlarmData[2].AttachListTokens.size() > 2){
+ if (testTask.calendarAlarmData[2].attachListTokens.size() > 2){
- AttachDataTokens = TestTask.CalendarAlarmData[2].AttachListTokens[2];
+ attachDataTokens = testTask.calendarAlarmData[2].attachListTokens[2];
}
- ASSERT_EQ("VGhpcyBpcyBhbiBleGFtcGxlIGZpbGU=", AttachData);
- ASSERT_EQ("text/plain", AttachDataFormatType);
- ASSERT_EQ("BASE64", AttachDataEncoding);
- ASSERT_EQ("BINARY", AttachDataValue);
- ASSERT_EQ("STUPID=EXAMPLE", AttachDataTokens);
+ ASSERT_EQ("VGhpcyBpcyBhbiBleGFtcGxlIGZpbGU=", attachData);
+ ASSERT_EQ("text/plain", attachDataFormatType);
+ ASSERT_EQ("BASE64", attachDataEncoding);
+ ASSERT_EQ("BINARY", attachDataValue);
+ ASSERT_EQ("STUPID=EXAMPLE", attachDataTokens);
// Test the first X-Token.
- if (TestTask.CalendarAlarmData[2].XTokensData.size() > 0){
+ if (testTask.calendarAlarmData[2].xTokensData.size() > 0){
- XTokenData = TestTask.CalendarAlarmData[2].XTokensData[0];
- XTokenName = TestTask.CalendarAlarmData[2].XTokensDataTokens[0];
+ xTokenData = testTask.calendarAlarmData[2].xTokensData[0];
+ xTokenName = testTask.calendarAlarmData[2].xTokensDataTokens[0];
}
- ASSERT_EQ("Example Data 1", XTokenData);
- ASSERT_EQ("X-EXAMPLE1;YAY=YES", XTokenName);
+ ASSERT_EQ("Example Data 1", xTokenData);
+ ASSERT_EQ("X-EXAMPLE1;YAY=YES", xTokenName);
// Test the second X-Token.
- XTokenData.clear();
- XTokenName.clear();
+ xTokenData.clear();
+ xTokenName.clear();
- if (TestTask.CalendarAlarmData[2].XTokensData.size() > 1){
+ if (testTask.calendarAlarmData[2].xTokensData.size() > 1){
- XTokenData = TestTask.CalendarAlarmData[2].XTokensData[1];
- XTokenName = TestTask.CalendarAlarmData[2].XTokensDataTokens[1];
+ xTokenData = testTask.calendarAlarmData[2].xTokensData[1];
+ xTokenName = testTask.calendarAlarmData[2].xTokensDataTokens[1];
}
- ASSERT_EQ("Example Data 2", XTokenData);
- ASSERT_EQ("X-EXAMPLE2;NOPE=YEP", XTokenName);
+ ASSERT_EQ("Example Data 2", xTokenData);
+ ASSERT_EQ("X-EXAMPLE2;NOPE=YEP", xTokenName);
// Test the third X-Token.
- XTokenData.clear();
- XTokenName.clear();
+ xTokenData.clear();
+ xTokenName.clear();
- if (TestTask.CalendarAlarmData[2].XTokensData.size() > 2){
+ if (testTask.calendarAlarmData[2].xTokensData.size() > 2){
- XTokenData = TestTask.CalendarAlarmData[2].XTokensData[2];
- XTokenName = TestTask.CalendarAlarmData[2].XTokensDataTokens[2];
+ xTokenData = testTask.calendarAlarmData[2].xTokensData[2];
+ xTokenName = testTask.calendarAlarmData[2].xTokensDataTokens[2];
}
- ASSERT_EQ("Example Data 3", XTokenData);
- ASSERT_EQ("X-EXAMPLE3;WORLD=NO", XTokenName);
+ ASSERT_EQ("Example Data 3", xTokenData);
+ ASSERT_EQ("X-EXAMPLE3;WORLD=NO", xTokenName);
}
TEST(iCalendarSaveTask, SaveTaskTests){
- CalendarTaskObject TestTask;
- CalendarTaskObject TestTask2;
- CalendarTaskObject TestTask3;
+ CalendarTaskObject testTask;
+ CalendarTaskObject testTask2;
+ CalendarTaskObject testTask3;
// Load the test journal information.
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestTask.LoadFile("iCalendarTask-Load1.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestTask.ValidBaseObject());
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTask.LoadFile("iCalendarTask-Load1.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testTask.ValidBaseObject());
- ASSERT_EQ(CALENDAROBJECTSAVE_CANNOTOPEN, TestTask.SaveFile("/stupidfilelocation/dontsavehere.ics"));
+ ASSERT_EQ(CALENDAROBJECTSAVE_CANNOTOPEN, testTask.SaveFile("/stupidfilelocation/dontsavehere.ics"));
// First task file.
- std::string SaveDataComparison = "BEGIN:VCALENDAR\n"
+ std::string saveDataComparison = "BEGIN:VCALENDAR\n"
"VERSION:2.0\n"
"PRODID:-//Xestia//Calendar Unit Testing//KW\n"
"BEGIN:VTODO\n"
"END:VTODO\n"
"END:VCALENDAR";
- std::string SaveData;
+ std::string saveData;
- TestTask.SaveString(&SaveData);
+ testTask.SaveString(&saveData);
- ASSERT_EQ(SaveDataComparison, SaveData);
+ ASSERT_EQ(saveDataComparison, saveData);
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestTask2.LoadFile("iCalendarTask-Load2.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestTask2.ValidBaseObject());
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTask2.LoadFile("iCalendarTask-Load2.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testTask2.ValidBaseObject());
// Second task file.
- SaveDataComparison = "BEGIN:VCALENDAR\n"
+ saveDataComparison = "BEGIN:VCALENDAR\n"
"VERSION:2.0\n"
"PRODID:-//Xestia//Calendar Unit Testing//KW\n"
"BEGIN:VTODO\n"
"END:VTODO\n"
"END:VCALENDAR";
- SaveData.clear();
+ saveData.clear();
- TestTask2.SaveString(&SaveData);
+ testTask2.SaveString(&saveData);
- ASSERT_EQ(SaveDataComparison, SaveData);
+ ASSERT_EQ(saveDataComparison, saveData);
// Third task file.
- SaveDataComparison = "BEGIN:VCALENDAR\n"
+ saveDataComparison = "BEGIN:VCALENDAR\n"
"VERSION:2.0\n"
"PRODID:-//Xestia//Calendar Unit Testing//KW\n"
"BEGIN:VTODO\n"
"END:VTODO\n"
"END:VCALENDAR";
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestTask3.LoadFile("iCalendarTask-Load3.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestTask3.ValidBaseObject());
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTask3.LoadFile("iCalendarTask-Load3.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testTask3.ValidBaseObject());
- SaveData.clear();
+ saveData.clear();
- TestTask3.SaveString(&SaveData);
+ testTask3.SaveString(&saveData);
- ASSERT_EQ(SaveDataComparison, SaveData);
+ ASSERT_EQ(saveDataComparison, saveData);
}
\ No newline at end of file
TEST(iCalendarTimezone, BasicTests){
- CalendarTimezoneObject TestTimezone;
+ CalendarTimezoneObject testTimezone;
- ASSERT_EQ(CALENDAROBJECTLOAD_MISSING, TestTimezone.LoadFile("iCalendarTimezone-Missing.vcf"));
- ASSERT_EQ(CALENDAROBJECTLOAD_CANNOTOPEN, TestTimezone.LoadFile("iCalendarTimezone-InvalidPermissions.vcf"));
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestTimezone.LoadFile("iCalendarTimezone-Load1.vcf"));
+ ASSERT_EQ(CALENDAROBJECTLOAD_MISSING, testTimezone.LoadFile("iCalendarTimezone-Missing.vcf"));
+ ASSERT_EQ(CALENDAROBJECTLOAD_CANNOTOPEN, testTimezone.LoadFile("iCalendarTimezone-InvalidPermissions.vcf"));
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTimezone.LoadFile("iCalendarTimezone-Load1.vcf"));
}
TEST(iCalendarTimezone, ObjectDataTests){
- CalendarTimezoneObject TestTimezone;
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestTimezone.LoadFile("iCalendarTimezone-Load2.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestTimezone.ValidBaseObject());
+ CalendarTimezoneObject testTimezone;
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTimezone.LoadFile("iCalendarTimezone-Load2.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testTimezone.ValidBaseObject());
// Tests for UID.
- ASSERT_EQ("Example/Starrgazy", TestTimezone.TimeZoneData);
- ASSERT_EQ("OTHER=PARAM", TestTimezone.TimeZoneDataTokens);
+ ASSERT_EQ("Example/Starrgazy", testTimezone.timeZoneData);
+ ASSERT_EQ("OTHER=PARAM", testTimezone.timeZoneDataTokens);
// Tests for LAST-MODIFIED.
- ASSERT_EQ("20160203T200700Z", TestTimezone.LastModifiedData);
- ASSERT_EQ("FUTURE=ODD", TestTimezone.LastModifiedTokens);
+ ASSERT_EQ("20160203T200700Z", testTimezone.lastModifiedData);
+ ASSERT_EQ("FUTURE=ODD", testTimezone.lastModifiedTokens);
// Tests for TZURL.
- ASSERT_EQ("http://www.example.com/", TestTimezone.TimeZoneURLData);
- ASSERT_EQ("URL=YES", TestTimezone.TimeZoneURLTokens);
+ ASSERT_EQ("http://www.example.com/", testTimezone.timeZoneURLData);
+ ASSERT_EQ("URL=YES", testTimezone.timeZoneURLTokens);
// Tests for the first STANDARD data.
- std::string DateTimeStartData;
- std::string TimeZoneOffsetToData;
- std::string TimeZoneOffsetFromData;
+ std::string dateTimeStartData;
+ std::string timeZoneOffsetToData;
+ std::string timeZoneOffsetFromData;
- if (TestTimezone.TimezoneStandardCollection.size() > 0){
+ if (testTimezone.timeZoneStandardCollection.size() > 0){
- DateTimeStartData = TestTimezone.TimezoneStandardCollection[0].DateTimeStartData;
+ dateTimeStartData = testTimezone.timeZoneStandardCollection[0].dateTimeStartData;
}
- if (TestTimezone.TimezoneStandardCollection.size() > 0){
+ if (testTimezone.timeZoneStandardCollection.size() > 0){
- TimeZoneOffsetToData = TestTimezone.TimezoneStandardCollection[0].TimeZoneOffsetToData;
+ timeZoneOffsetToData = testTimezone.timeZoneStandardCollection[0].timeZoneOffsetToData;
}
- if (TestTimezone.TimezoneStandardCollection.size() > 0){
+ if (testTimezone.timeZoneStandardCollection.size() > 0){
- TimeZoneOffsetFromData = TestTimezone.TimezoneStandardCollection[0].TimeZoneOffsetFromData;
+ timeZoneOffsetFromData = testTimezone.timeZoneStandardCollection[0].timeZoneOffsetFromData;
}
- ASSERT_EQ("20160204T020000", DateTimeStartData);
- ASSERT_EQ("-0400", TimeZoneOffsetToData);
- ASSERT_EQ("-0500", TimeZoneOffsetFromData);
+ ASSERT_EQ("20160204T020000", dateTimeStartData);
+ ASSERT_EQ("-0400", timeZoneOffsetToData);
+ ASSERT_EQ("-0500", timeZoneOffsetFromData);
// Tests for the second STANDARD data.
- std::string DateTimeStartTokens;
- std::string TimeZoneOffsetToTokens;
- std::string TimeZoneOffsetFromTokens;
+ std::string dateTimeStartTokens;
+ std::string timeZoneOffsetToTokens;
+ std::string timeZoneOffsetFromTokens;
- std::string RecurranceRuleData;
- std::string RecurranceRuleDataTokens;
+ std::string recurranceRuleData;
+ std::string recurranceRuleDataTokens;
- std::string CommentList;
- std::string CommentListAltRep;
- std::string CommentListLanguage;
- std::string CommentListTokens;
+ std::string commentList;
+ std::string commentListAltRep;
+ std::string commentListLanguage;
+ std::string commentListTokens;
- std::string RecurranceDateData;
- std::string RecurranceDateValue;
- std::string RecurranceDateDataTimeZoneParam;
- std::string RecurranceDateDataTokens;
+ std::string recurranceDateData;
+ std::string recurranceDateValue;
+ std::string recurranceDateDatatimeZoneParam;
+ std::string recurranceDateDataTokens;
- std::string TimeZoneNameData;
- std::string TimeZoneNameLanguage;
- std::string TimeZoneNameTokens;
+ std::string timeZoneNameData;
+ std::string timeZoneNameLanguage;
+ std::string timeZoneNameTokens;
- std::string XTokensData;
- std::string XTokensDataTokens;
+ std::string xTokensData;
+ std::string xTokensDataTokens;
- DateTimeStartData.clear();
- TimeZoneOffsetToData.clear();
- TimeZoneOffsetFromData.clear();
+ dateTimeStartData.clear();
+ timeZoneOffsetToData.clear();
+ timeZoneOffsetFromData.clear();
- if (TestTimezone.TimezoneStandardCollection.size() > 1){
+ if (testTimezone.timeZoneStandardCollection.size() > 1){
- DateTimeStartData = TestTimezone.TimezoneStandardCollection[1].DateTimeStartData;
- DateTimeStartTokens = TestTimezone.TimezoneStandardCollection[1].DateTimeStartTokens;
+ dateTimeStartData = testTimezone.timeZoneStandardCollection[1].dateTimeStartData;
+ dateTimeStartTokens = testTimezone.timeZoneStandardCollection[1].dateTimeStartTokens;
}
- if (TestTimezone.TimezoneStandardCollection.size() > 1){
+ if (testTimezone.timeZoneStandardCollection.size() > 1){
- TimeZoneOffsetToData = TestTimezone.TimezoneStandardCollection[1].TimeZoneOffsetToData;
- TimeZoneOffsetToTokens = TestTimezone.TimezoneStandardCollection[1].TimeZoneOffsetToTokens;
+ timeZoneOffsetToData = testTimezone.timeZoneStandardCollection[1].timeZoneOffsetToData;
+ timeZoneOffsetToTokens = testTimezone.timeZoneStandardCollection[1].timeZoneOffsetToTokens;
}
- if (TestTimezone.TimezoneStandardCollection.size() > 1){
+ if (testTimezone.timeZoneStandardCollection.size() > 1){
- TimeZoneOffsetFromData = TestTimezone.TimezoneStandardCollection[1].TimeZoneOffsetFromData;
- TimeZoneOffsetFromTokens = TestTimezone.TimezoneStandardCollection[1].TimeZoneOffsetFromTokens;
+ timeZoneOffsetFromData = testTimezone.timeZoneStandardCollection[1].timeZoneOffsetFromData;
+ timeZoneOffsetFromTokens = testTimezone.timeZoneStandardCollection[1].timeZoneOffsetFromTokens;
}
- ASSERT_EQ("20160205T020000", DateTimeStartData);
- ASSERT_EQ("MEEP=MOO", DateTimeStartTokens);
- ASSERT_EQ("-0400", TimeZoneOffsetToData);
- ASSERT_EQ("EXAMPLE=DATA", TimeZoneOffsetToTokens);
- ASSERT_EQ("-0500", TimeZoneOffsetFromData);
- ASSERT_EQ("LETS=GO", TimeZoneOffsetFromTokens);
+ ASSERT_EQ("20160205T020000", dateTimeStartData);
+ ASSERT_EQ("MEEP=MOO", dateTimeStartTokens);
+ ASSERT_EQ("-0400", timeZoneOffsetToData);
+ ASSERT_EQ("EXAMPLE=DATA", timeZoneOffsetToTokens);
+ ASSERT_EQ("-0500", timeZoneOffsetFromData);
+ ASSERT_EQ("LETS=GO", timeZoneOffsetFromTokens);
// Tests for third STANDARD data.
- DateTimeStartData.clear();
- DateTimeStartTokens.clear();
- TimeZoneOffsetToData.clear();
- TimeZoneOffsetToTokens.clear();
- TimeZoneOffsetFromData.clear();
- TimeZoneOffsetFromTokens.clear();
+ dateTimeStartData.clear();
+ dateTimeStartTokens.clear();
+ timeZoneOffsetToData.clear();
+ timeZoneOffsetToTokens.clear();
+ timeZoneOffsetFromData.clear();
+ timeZoneOffsetFromTokens.clear();
- if (TestTimezone.TimezoneStandardCollection.size() > 2){
+ if (testTimezone.timeZoneStandardCollection.size() > 2){
- DateTimeStartData = TestTimezone.TimezoneStandardCollection[2].DateTimeStartData;
- DateTimeStartTokens = TestTimezone.TimezoneStandardCollection[2].DateTimeStartTokens;
+ dateTimeStartData = testTimezone.timeZoneStandardCollection[2].dateTimeStartData;
+ dateTimeStartTokens = testTimezone.timeZoneStandardCollection[2].dateTimeStartTokens;
}
- if (TestTimezone.TimezoneStandardCollection.size() > 2){
+ if (testTimezone.timeZoneStandardCollection.size() > 2){
- TimeZoneOffsetToData = TestTimezone.TimezoneStandardCollection[2].TimeZoneOffsetToData;
- TimeZoneOffsetToTokens = TestTimezone.TimezoneStandardCollection[2].TimeZoneOffsetToTokens;
+ timeZoneOffsetToData = testTimezone.timeZoneStandardCollection[2].timeZoneOffsetToData;
+ timeZoneOffsetToTokens = testTimezone.timeZoneStandardCollection[2].timeZoneOffsetToTokens;
}
- if (TestTimezone.TimezoneStandardCollection.size() > 2){
+ if (testTimezone.timeZoneStandardCollection.size() > 2){
- TimeZoneOffsetFromData = TestTimezone.TimezoneStandardCollection[2].TimeZoneOffsetFromData;
- TimeZoneOffsetFromTokens = TestTimezone.TimezoneStandardCollection[2].TimeZoneOffsetFromTokens;
+ timeZoneOffsetFromData = testTimezone.timeZoneStandardCollection[2].timeZoneOffsetFromData;
+ timeZoneOffsetFromTokens = testTimezone.timeZoneStandardCollection[2].timeZoneOffsetFromTokens;
}
- if (TestTimezone.TimezoneStandardCollection.size() > 2 &&
- TestTimezone.TimezoneStandardCollection[2].CommentList.size() > 0){
+ if (testTimezone.timeZoneStandardCollection.size() > 2 &&
+ testTimezone.timeZoneStandardCollection[2].commentList.size() > 0){
- CommentList = TestTimezone.TimezoneStandardCollection[2].CommentList[0];
- CommentListAltRep = TestTimezone.TimezoneStandardCollection[2].CommentListAltRep[0];
- CommentListLanguage = TestTimezone.TimezoneStandardCollection[2].CommentListLanguage[0];
- CommentListTokens = TestTimezone.TimezoneStandardCollection[2].CommentListTokens[0];
+ commentList = testTimezone.timeZoneStandardCollection[2].commentList[0];
+ commentListAltRep = testTimezone.timeZoneStandardCollection[2].commentListAltRep[0];
+ commentListLanguage = testTimezone.timeZoneStandardCollection[2].commentListLanguage[0];
+ commentListTokens = testTimezone.timeZoneStandardCollection[2].commentListTokens[0];
}
- if (TestTimezone.TimezoneStandardCollection.size() > 2 &&
- TestTimezone.TimezoneStandardCollection[2].RecurranceRuleData.size() > 0){
+ if (testTimezone.timeZoneStandardCollection.size() > 2 &&
+ testTimezone.timeZoneStandardCollection[2].recurranceRuleData.size() > 0){
- RecurranceRuleData = TestTimezone.TimezoneStandardCollection[2].RecurranceRuleData;
- RecurranceRuleDataTokens = TestTimezone.TimezoneStandardCollection[2].RecurranceRuleDataTokens;
+ recurranceRuleData = testTimezone.timeZoneStandardCollection[2].recurranceRuleData;
+ recurranceRuleDataTokens = testTimezone.timeZoneStandardCollection[2].recurranceRuleDataTokens;
}
- if (TestTimezone.TimezoneStandardCollection.size() > 2 &&
- TestTimezone.TimezoneStandardCollection[2].RecurranceDateData.size() > 0){
+ if (testTimezone.timeZoneStandardCollection.size() > 2 &&
+ testTimezone.timeZoneStandardCollection[2].recurranceDateData.size() > 0){
- RecurranceDateData = TestTimezone.TimezoneStandardCollection[2].RecurranceDateData[0];
- RecurranceDateValue = TestTimezone.TimezoneStandardCollection[2].RecurranceDateDataValue[0];
- RecurranceDateDataTimeZoneParam = TestTimezone.TimezoneStandardCollection[2].RecurranceDateDataTimeZoneParam[0];
- RecurranceDateDataTokens = TestTimezone.TimezoneStandardCollection[2].RecurranceDateDataTokens[0];
+ recurranceDateData = testTimezone.timeZoneStandardCollection[2].recurranceDateData[0];
+ recurranceDateValue = testTimezone.timeZoneStandardCollection[2].recurranceDateDataValue[0];
+ recurranceDateDatatimeZoneParam = testTimezone.timeZoneStandardCollection[2].recurranceDateDatatimeZoneParam[0];
+ recurranceDateDataTokens = testTimezone.timeZoneStandardCollection[2].recurranceDateDataTokens[0];
}
- if (TestTimezone.TimezoneStandardCollection.size() > 2 &&
- TestTimezone.TimezoneStandardCollection[2].TimeZoneNameData.size() > 0){
+ if (testTimezone.timeZoneStandardCollection.size() > 2 &&
+ testTimezone.timeZoneStandardCollection[2].timeZoneNameData.size() > 0){
- TimeZoneNameData = TestTimezone.TimezoneStandardCollection[2].TimeZoneNameData[0];
- TimeZoneNameLanguage = TestTimezone.TimezoneStandardCollection[2].TimeZoneNameLanguage[0];
- TimeZoneNameTokens = TestTimezone.TimezoneStandardCollection[2].TimeZoneNameTokens[0];
+ timeZoneNameData = testTimezone.timeZoneStandardCollection[2].timeZoneNameData[0];
+ timeZoneNameLanguage = testTimezone.timeZoneStandardCollection[2].timeZoneNameLanguage[0];
+ timeZoneNameTokens = testTimezone.timeZoneStandardCollection[2].timeZoneNameTokens[0];
}
- if (TestTimezone.TimezoneStandardCollection.size() > 2 &&
- TestTimezone.TimezoneStandardCollection[2].XTokensData.size() > 0){
+ if (testTimezone.timeZoneStandardCollection.size() > 2 &&
+ testTimezone.timeZoneStandardCollection[2].xTokensData.size() > 0){
- XTokensData = TestTimezone.TimezoneStandardCollection[2].XTokensData[0];
- XTokensDataTokens = TestTimezone.TimezoneStandardCollection[2].XTokensDataTokens[0];
+ xTokensData = testTimezone.timeZoneStandardCollection[2].xTokensData[0];
+ xTokensDataTokens = testTimezone.timeZoneStandardCollection[2].xTokensDataTokens[0];
}
- ASSERT_EQ("20160206T020000", DateTimeStartData);
- ASSERT_EQ("MEEP=MOO", DateTimeStartTokens);
- ASSERT_EQ("-0400", TimeZoneOffsetToData);
- ASSERT_EQ("EXAMPLE=DATA", TimeZoneOffsetToTokens);
- ASSERT_EQ("-0500", TimeZoneOffsetFromData);
- ASSERT_EQ("LETS=GO", TimeZoneOffsetFromTokens);
+ ASSERT_EQ("20160206T020000", dateTimeStartData);
+ ASSERT_EQ("MEEP=MOO", dateTimeStartTokens);
+ ASSERT_EQ("-0400", timeZoneOffsetToData);
+ ASSERT_EQ("EXAMPLE=DATA", timeZoneOffsetToTokens);
+ ASSERT_EQ("-0500", timeZoneOffsetFromData);
+ ASSERT_EQ("LETS=GO", timeZoneOffsetFromTokens);
- ASSERT_EQ("Example timezone comment.", CommentList);
- ASSERT_EQ("null:nodata", CommentListAltRep);
- ASSERT_EQ("kw", CommentListLanguage);
- ASSERT_EQ("YO=YOYOS", CommentListTokens);
+ ASSERT_EQ("Example timezone comment.", commentList);
+ ASSERT_EQ("null:nodata", commentListAltRep);
+ ASSERT_EQ("kw", commentListLanguage);
+ ASSERT_EQ("YO=YOYOS", commentListTokens);
- ASSERT_EQ("FREQ=DAILY;COUNT=10", RecurranceRuleData);
- ASSERT_EQ("YAK=YES", RecurranceRuleDataTokens);
+ ASSERT_EQ("FREQ=DAILY;COUNT=10", recurranceRuleData);
+ ASSERT_EQ("YAK=YES", recurranceRuleDataTokens);
- ASSERT_EQ("20160205,20160207,20160216,20160305", RecurranceDateData);
- ASSERT_EQ("DATE", RecurranceDateValue);
- ASSERT_EQ("Europe/Truro", RecurranceDateDataTimeZoneParam);
- ASSERT_EQ("BEEP=BOOP", RecurranceDateDataTokens);
+ ASSERT_EQ("20160205,20160207,20160216,20160305", recurranceDateData);
+ ASSERT_EQ("DATE", recurranceDateValue);
+ ASSERT_EQ("Europe/Truro", recurranceDateDatatimeZoneParam);
+ ASSERT_EQ("BEEP=BOOP", recurranceDateDataTokens);
- ASSERT_EQ("Example Timezone Name 1", TimeZoneNameData);
- ASSERT_EQ("en", TimeZoneNameLanguage);
- ASSERT_EQ("NOPE=YES", TimeZoneNameTokens);
+ ASSERT_EQ("Example Timezone Name 1", timeZoneNameData);
+ ASSERT_EQ("en", timeZoneNameLanguage);
+ ASSERT_EQ("NOPE=YES", timeZoneNameTokens);
- ASSERT_EQ("Example Timezone Name 1", TimeZoneNameData);
- ASSERT_EQ("en", TimeZoneNameLanguage);
+ ASSERT_EQ("Example Timezone Name 1", timeZoneNameData);
+ ASSERT_EQ("en", timeZoneNameLanguage);
- ASSERT_EQ("Meep", XTokensData);
- ASSERT_EQ("X-MOO", XTokensDataTokens);
+ ASSERT_EQ("Meep", xTokensData);
+ ASSERT_EQ("X-MOO", xTokensDataTokens);
- XTokensData.clear();
- XTokensDataTokens.clear();
+ xTokensData.clear();
+ xTokensDataTokens.clear();
- if (TestTimezone.TimezoneStandardCollection.size() > 2 &&
- TestTimezone.TimezoneStandardCollection[2].XTokensData.size() > 1){
+ if (testTimezone.timeZoneStandardCollection.size() > 2 &&
+ testTimezone.timeZoneStandardCollection[2].xTokensData.size() > 1){
- XTokensData = TestTimezone.TimezoneStandardCollection[2].XTokensData[1];
- XTokensDataTokens = TestTimezone.TimezoneStandardCollection[2].XTokensDataTokens[1];
+ xTokensData = testTimezone.timeZoneStandardCollection[2].xTokensData[1];
+ xTokensDataTokens = testTimezone.timeZoneStandardCollection[2].xTokensDataTokens[1];
}
- ASSERT_EQ("Moop", XTokensData);
- ASSERT_EQ("X-MOO", XTokensDataTokens);
+ ASSERT_EQ("Moop", xTokensData);
+ ASSERT_EQ("X-MOO", xTokensDataTokens);
- XTokensData.clear();
- XTokensDataTokens.clear();
+ xTokensData.clear();
+ xTokensDataTokens.clear();
- if (TestTimezone.TimezoneStandardCollection.size() > 2 &&
- TestTimezone.TimezoneStandardCollection[2].XTokensData.size() > 2){
+ if (testTimezone.timeZoneStandardCollection.size() > 2 &&
+ testTimezone.timeZoneStandardCollection[2].xTokensData.size() > 2){
- XTokensData = TestTimezone.TimezoneStandardCollection[2].XTokensData[2];
- XTokensDataTokens = TestTimezone.TimezoneStandardCollection[2].XTokensDataTokens[2];
+ xTokensData = testTimezone.timeZoneStandardCollection[2].xTokensData[2];
+ xTokensDataTokens = testTimezone.timeZoneStandardCollection[2].xTokensDataTokens[2];
}
- ASSERT_EQ("Zaap", XTokensData);
- ASSERT_EQ("X-MOO;MEEP=YIKES", XTokensDataTokens);
+ ASSERT_EQ("Zaap", xTokensData);
+ ASSERT_EQ("X-MOO;MEEP=YIKES", xTokensDataTokens);
- XTokensData.clear();
- XTokensDataTokens.clear();
+ xTokensData.clear();
+ xTokensDataTokens.clear();
- if (TestTimezone.TimezoneStandardCollection.size() > 2 &&
- TestTimezone.TimezoneStandardCollection[2].XTokensData.size() > 3){
+ if (testTimezone.timeZoneStandardCollection.size() > 2 &&
+ testTimezone.timeZoneStandardCollection[2].xTokensData.size() > 3){
- XTokensData = TestTimezone.TimezoneStandardCollection[2].XTokensData[3];
- XTokensDataTokens = TestTimezone.TimezoneStandardCollection[2].XTokensDataTokens[3];
+ xTokensData = testTimezone.timeZoneStandardCollection[2].xTokensData[3];
+ xTokensDataTokens = testTimezone.timeZoneStandardCollection[2].xTokensDataTokens[3];
}
- ASSERT_EQ("Fork", XTokensData);
- ASSERT_EQ("X-ITEM", XTokensDataTokens);
+ ASSERT_EQ("Fork", xTokensData);
+ ASSERT_EQ("X-ITEM", xTokensDataTokens);
- XTokensData.clear();
- XTokensDataTokens.clear();
+ xTokensData.clear();
+ xTokensDataTokens.clear();
- if (TestTimezone.TimezoneStandardCollection.size() > 2 &&
- TestTimezone.TimezoneStandardCollection[2].XTokensData.size() > 4){
+ if (testTimezone.timeZoneStandardCollection.size() > 2 &&
+ testTimezone.timeZoneStandardCollection[2].xTokensData.size() > 4){
- XTokensData = TestTimezone.TimezoneStandardCollection[2].XTokensData[4];
- XTokensDataTokens = TestTimezone.TimezoneStandardCollection[2].XTokensDataTokens[4];
+ xTokensData = testTimezone.timeZoneStandardCollection[2].xTokensData[4];
+ xTokensDataTokens = testTimezone.timeZoneStandardCollection[2].xTokensDataTokens[4];
}
- ASSERT_EQ("Spoon", XTokensData);
- ASSERT_EQ("X-ITEM", XTokensDataTokens);
+ ASSERT_EQ("Spoon", xTokensData);
+ ASSERT_EQ("X-ITEM", xTokensDataTokens);
- XTokensData.clear();
- XTokensDataTokens.clear();
+ xTokensData.clear();
+ xTokensDataTokens.clear();
- if (TestTimezone.TimezoneStandardCollection.size() > 2 &&
- TestTimezone.TimezoneStandardCollection[2].XTokensData.size() > 5){
+ if (testTimezone.timeZoneStandardCollection.size() > 2 &&
+ testTimezone.timeZoneStandardCollection[2].xTokensData.size() > 5){
- XTokensData = TestTimezone.TimezoneStandardCollection[2].XTokensData[5];
- XTokensDataTokens = TestTimezone.TimezoneStandardCollection[2].XTokensDataTokens[5];
+ xTokensData = testTimezone.timeZoneStandardCollection[2].xTokensData[5];
+ xTokensDataTokens = testTimezone.timeZoneStandardCollection[2].xTokensDataTokens[5];
}
- ASSERT_EQ("Knife", XTokensData);
- ASSERT_EQ("X-ITEM;DIRTY=NO", XTokensDataTokens);
+ ASSERT_EQ("Knife", xTokensData);
+ ASSERT_EQ("X-ITEM;DIRTY=NO", xTokensDataTokens);
- XTokensData.clear();
- XTokensDataTokens.clear();
+ xTokensData.clear();
+ xTokensDataTokens.clear();
- if (TestTimezone.TimezoneStandardCollection.size() > 2 &&
- TestTimezone.TimezoneStandardCollection[2].XTokensData.size() > 6){
+ if (testTimezone.timeZoneStandardCollection.size() > 2 &&
+ testTimezone.timeZoneStandardCollection[2].xTokensData.size() > 6){
- XTokensData = TestTimezone.TimezoneStandardCollection[2].XTokensData[6];
- XTokensDataTokens = TestTimezone.TimezoneStandardCollection[2].XTokensDataTokens[6];
+ xTokensData = testTimezone.timeZoneStandardCollection[2].xTokensData[6];
+ xTokensDataTokens = testTimezone.timeZoneStandardCollection[2].xTokensDataTokens[6];
}
- ASSERT_EQ("1", XTokensData);
- ASSERT_EQ("X-NOPE", XTokensDataTokens);
+ ASSERT_EQ("1", xTokensData);
+ ASSERT_EQ("X-NOPE", xTokensDataTokens);
- XTokensData.clear();
- XTokensDataTokens.clear();
+ xTokensData.clear();
+ xTokensDataTokens.clear();
- if (TestTimezone.TimezoneStandardCollection.size() > 2 &&
- TestTimezone.TimezoneStandardCollection[2].XTokensData.size() > 7){
+ if (testTimezone.timeZoneStandardCollection.size() > 2 &&
+ testTimezone.timeZoneStandardCollection[2].xTokensData.size() > 7){
- XTokensData = TestTimezone.TimezoneStandardCollection[2].XTokensData[7];
- XTokensDataTokens = TestTimezone.TimezoneStandardCollection[2].XTokensDataTokens[7];
+ xTokensData = testTimezone.timeZoneStandardCollection[2].xTokensData[7];
+ xTokensDataTokens = testTimezone.timeZoneStandardCollection[2].xTokensDataTokens[7];
}
- ASSERT_EQ("2", XTokensData);
- ASSERT_EQ("X-NOPE", XTokensDataTokens);
+ ASSERT_EQ("2", xTokensData);
+ ASSERT_EQ("X-NOPE", xTokensDataTokens);
- XTokensData.clear();
- XTokensDataTokens.clear();
+ xTokensData.clear();
+ xTokensDataTokens.clear();
- if (TestTimezone.TimezoneStandardCollection.size() > 2 &&
- TestTimezone.TimezoneStandardCollection[2].XTokensData.size() > 8){
+ if (testTimezone.timeZoneStandardCollection.size() > 2 &&
+ testTimezone.timeZoneStandardCollection[2].xTokensData.size() > 8){
- XTokensData = TestTimezone.TimezoneStandardCollection[2].XTokensData[8];
- XTokensDataTokens = TestTimezone.TimezoneStandardCollection[2].XTokensDataTokens[8];
+ xTokensData = testTimezone.timeZoneStandardCollection[2].xTokensData[8];
+ xTokensDataTokens = testTimezone.timeZoneStandardCollection[2].xTokensDataTokens[8];
}
- ASSERT_EQ("3", XTokensData);
- ASSERT_EQ("X-NOPE;LONG=YES", XTokensDataTokens);
+ ASSERT_EQ("3", xTokensData);
+ ASSERT_EQ("X-NOPE;LONG=YES", xTokensDataTokens);
// Tests for the first DAYLIGHT data.
- DateTimeStartData.clear();
- TimeZoneOffsetToData.clear();
- TimeZoneOffsetFromData.clear();
+ dateTimeStartData.clear();
+ timeZoneOffsetToData.clear();
+ timeZoneOffsetFromData.clear();
- if (TestTimezone.TimezoneDaylightCollection.size() > 0){
+ if (testTimezone.timeZoneDaylightCollection.size() > 0){
- DateTimeStartData = TestTimezone.TimezoneDaylightCollection[0].DateTimeStartData;
+ dateTimeStartData = testTimezone.timeZoneDaylightCollection[0].dateTimeStartData;
}
- if (TestTimezone.TimezoneDaylightCollection.size() > 0){
+ if (testTimezone.timeZoneDaylightCollection.size() > 0){
- TimeZoneOffsetToData = TestTimezone.TimezoneDaylightCollection[0].TimeZoneOffsetToData;
+ timeZoneOffsetToData = testTimezone.timeZoneDaylightCollection[0].timeZoneOffsetToData;
}
- if (TestTimezone.TimezoneDaylightCollection.size() > 0){
+ if (testTimezone.timeZoneDaylightCollection.size() > 0){
- TimeZoneOffsetFromData = TestTimezone.TimezoneDaylightCollection[0].TimeZoneOffsetFromData;
+ timeZoneOffsetFromData = testTimezone.timeZoneDaylightCollection[0].timeZoneOffsetFromData;
}
- ASSERT_EQ("20160204T020000", DateTimeStartData);
- ASSERT_EQ("-0400", TimeZoneOffsetToData);
- ASSERT_EQ("-0500", TimeZoneOffsetFromData);
+ ASSERT_EQ("20160204T020000", dateTimeStartData);
+ ASSERT_EQ("-0400", timeZoneOffsetToData);
+ ASSERT_EQ("-0500", timeZoneOffsetFromData);
// Tests for the second DAYLIGHT data.
- DateTimeStartTokens.clear();
- TimeZoneOffsetToTokens.clear();
- TimeZoneOffsetFromTokens.clear();
+ dateTimeStartTokens.clear();
+ timeZoneOffsetToTokens.clear();
+ timeZoneOffsetFromTokens.clear();
- RecurranceRuleData.clear();
- RecurranceRuleDataTokens.clear();
+ recurranceRuleData.clear();
+ recurranceRuleDataTokens.clear();
- CommentList.clear();
- CommentListAltRep.clear();
- CommentListLanguage.clear();
- CommentListTokens.clear();
+ commentList.clear();
+ commentListAltRep.clear();
+ commentListLanguage.clear();
+ commentListTokens.clear();
- RecurranceDateData.clear();
- RecurranceDateValue.clear();
- RecurranceDateDataTimeZoneParam.clear();
- RecurranceDateDataTokens.clear();
+ recurranceDateData.clear();
+ recurranceDateValue.clear();
+ recurranceDateDatatimeZoneParam.clear();
+ recurranceDateDataTokens.clear();
- TimeZoneNameData.clear();
- TimeZoneNameLanguage.clear();
- TimeZoneNameTokens.clear();
+ timeZoneNameData.clear();
+ timeZoneNameLanguage.clear();
+ timeZoneNameTokens.clear();
- XTokensData.clear();
- XTokensDataTokens.clear();
+ xTokensData.clear();
+ xTokensDataTokens.clear();
- DateTimeStartData.clear();
- TimeZoneOffsetToData.clear();
- TimeZoneOffsetFromData.clear();
+ dateTimeStartData.clear();
+ timeZoneOffsetToData.clear();
+ timeZoneOffsetFromData.clear();
- if (TestTimezone.TimezoneDaylightCollection.size() > 1){
+ if (testTimezone.timeZoneDaylightCollection.size() > 1){
- DateTimeStartData = TestTimezone.TimezoneDaylightCollection[1].DateTimeStartData;
- DateTimeStartTokens = TestTimezone.TimezoneDaylightCollection[1].DateTimeStartTokens;
+ dateTimeStartData = testTimezone.timeZoneDaylightCollection[1].dateTimeStartData;
+ dateTimeStartTokens = testTimezone.timeZoneDaylightCollection[1].dateTimeStartTokens;
}
- if (TestTimezone.TimezoneDaylightCollection.size() > 1){
+ if (testTimezone.timeZoneDaylightCollection.size() > 1){
- TimeZoneOffsetToData = TestTimezone.TimezoneDaylightCollection[1].TimeZoneOffsetToData;
- TimeZoneOffsetToTokens = TestTimezone.TimezoneDaylightCollection[1].TimeZoneOffsetToTokens;
+ timeZoneOffsetToData = testTimezone.timeZoneDaylightCollection[1].timeZoneOffsetToData;
+ timeZoneOffsetToTokens = testTimezone.timeZoneDaylightCollection[1].timeZoneOffsetToTokens;
}
- if (TestTimezone.TimezoneDaylightCollection.size() > 1){
+ if (testTimezone.timeZoneDaylightCollection.size() > 1){
- TimeZoneOffsetFromData = TestTimezone.TimezoneDaylightCollection[1].TimeZoneOffsetFromData;
- TimeZoneOffsetFromTokens = TestTimezone.TimezoneDaylightCollection[1].TimeZoneOffsetFromTokens;
+ timeZoneOffsetFromData = testTimezone.timeZoneDaylightCollection[1].timeZoneOffsetFromData;
+ timeZoneOffsetFromTokens = testTimezone.timeZoneDaylightCollection[1].timeZoneOffsetFromTokens;
}
- ASSERT_EQ("20160205T020000", DateTimeStartData);
- ASSERT_EQ("MEEP=MOO", DateTimeStartTokens);
- ASSERT_EQ("-0400", TimeZoneOffsetToData);
- ASSERT_EQ("EXAMPLE=DATA", TimeZoneOffsetToTokens);
- ASSERT_EQ("-0500", TimeZoneOffsetFromData);
- ASSERT_EQ("LETS=GO", TimeZoneOffsetFromTokens);
+ ASSERT_EQ("20160205T020000", dateTimeStartData);
+ ASSERT_EQ("MEEP=MOO", dateTimeStartTokens);
+ ASSERT_EQ("-0400", timeZoneOffsetToData);
+ ASSERT_EQ("EXAMPLE=DATA", timeZoneOffsetToTokens);
+ ASSERT_EQ("-0500", timeZoneOffsetFromData);
+ ASSERT_EQ("LETS=GO", timeZoneOffsetFromTokens);
// Tests for third DAYLIGHT data.
- DateTimeStartData.clear();
- DateTimeStartTokens.clear();
- TimeZoneOffsetToData.clear();
- TimeZoneOffsetToTokens.clear();
- TimeZoneOffsetFromData.clear();
- TimeZoneOffsetFromTokens.clear();
+ dateTimeStartData.clear();
+ dateTimeStartTokens.clear();
+ timeZoneOffsetToData.clear();
+ timeZoneOffsetToTokens.clear();
+ timeZoneOffsetFromData.clear();
+ timeZoneOffsetFromTokens.clear();
- if (TestTimezone.TimezoneDaylightCollection.size() > 2){
+ if (testTimezone.timeZoneDaylightCollection.size() > 2){
- DateTimeStartData = TestTimezone.TimezoneDaylightCollection[2].DateTimeStartData;
- DateTimeStartTokens = TestTimezone.TimezoneDaylightCollection[2].DateTimeStartTokens;
+ dateTimeStartData = testTimezone.timeZoneDaylightCollection[2].dateTimeStartData;
+ dateTimeStartTokens = testTimezone.timeZoneDaylightCollection[2].dateTimeStartTokens;
}
- if (TestTimezone.TimezoneDaylightCollection.size() > 2){
+ if (testTimezone.timeZoneDaylightCollection.size() > 2){
- TimeZoneOffsetToData = TestTimezone.TimezoneDaylightCollection[2].TimeZoneOffsetToData;
- TimeZoneOffsetToTokens = TestTimezone.TimezoneDaylightCollection[2].TimeZoneOffsetToTokens;
+ timeZoneOffsetToData = testTimezone.timeZoneDaylightCollection[2].timeZoneOffsetToData;
+ timeZoneOffsetToTokens = testTimezone.timeZoneDaylightCollection[2].timeZoneOffsetToTokens;
}
- if (TestTimezone.TimezoneDaylightCollection.size() > 2){
+ if (testTimezone.timeZoneDaylightCollection.size() > 2){
- TimeZoneOffsetFromData = TestTimezone.TimezoneDaylightCollection[2].TimeZoneOffsetFromData;
- TimeZoneOffsetFromTokens = TestTimezone.TimezoneDaylightCollection[2].TimeZoneOffsetFromTokens;
+ timeZoneOffsetFromData = testTimezone.timeZoneDaylightCollection[2].timeZoneOffsetFromData;
+ timeZoneOffsetFromTokens = testTimezone.timeZoneDaylightCollection[2].timeZoneOffsetFromTokens;
}
- if (TestTimezone.TimezoneDaylightCollection.size() > 2 &&
- TestTimezone.TimezoneDaylightCollection[2].CommentList.size() > 0){
+ if (testTimezone.timeZoneDaylightCollection.size() > 2 &&
+ testTimezone.timeZoneDaylightCollection[2].commentList.size() > 0){
- CommentList = TestTimezone.TimezoneDaylightCollection[2].CommentList[0];
- CommentListAltRep = TestTimezone.TimezoneDaylightCollection[2].CommentListAltRep[0];
- CommentListLanguage = TestTimezone.TimezoneDaylightCollection[2].CommentListLanguage[0];
- CommentListTokens = TestTimezone.TimezoneDaylightCollection[2].CommentListTokens[0];
+ commentList = testTimezone.timeZoneDaylightCollection[2].commentList[0];
+ commentListAltRep = testTimezone.timeZoneDaylightCollection[2].commentListAltRep[0];
+ commentListLanguage = testTimezone.timeZoneDaylightCollection[2].commentListLanguage[0];
+ commentListTokens = testTimezone.timeZoneDaylightCollection[2].commentListTokens[0];
}
- if (TestTimezone.TimezoneDaylightCollection.size() > 2 &&
- TestTimezone.TimezoneDaylightCollection[2].RecurranceRuleData.size() > 0){
+ if (testTimezone.timeZoneDaylightCollection.size() > 2 &&
+ testTimezone.timeZoneDaylightCollection[2].recurranceRuleData.size() > 0){
- RecurranceRuleData = TestTimezone.TimezoneDaylightCollection[2].RecurranceRuleData;
- RecurranceRuleDataTokens = TestTimezone.TimezoneDaylightCollection[2].RecurranceRuleDataTokens;
+ recurranceRuleData = testTimezone.timeZoneDaylightCollection[2].recurranceRuleData;
+ recurranceRuleDataTokens = testTimezone.timeZoneDaylightCollection[2].recurranceRuleDataTokens;
}
- if (TestTimezone.TimezoneDaylightCollection.size() > 2 &&
- TestTimezone.TimezoneDaylightCollection[2].RecurranceDateData.size() > 0){
+ if (testTimezone.timeZoneDaylightCollection.size() > 2 &&
+ testTimezone.timeZoneDaylightCollection[2].recurranceDateData.size() > 0){
- RecurranceDateData = TestTimezone.TimezoneDaylightCollection[2].RecurranceDateData[0];
- RecurranceDateValue = TestTimezone.TimezoneDaylightCollection[2].RecurranceDateDataValue[0];
- RecurranceDateDataTimeZoneParam = TestTimezone.TimezoneDaylightCollection[2].RecurranceDateDataTimeZoneParam[0];
- RecurranceDateDataTokens = TestTimezone.TimezoneDaylightCollection[2].RecurranceDateDataTokens[0];
+ recurranceDateData = testTimezone.timeZoneDaylightCollection[2].recurranceDateData[0];
+ recurranceDateValue = testTimezone.timeZoneDaylightCollection[2].recurranceDateDataValue[0];
+ recurranceDateDataTimeZoneParam = testTimezone.timeZoneDaylightCollection[2].recurranceDateDataTimeZoneParam[0];
+ recurranceDateDataTokens = testTimezone.timeZoneDaylightCollection[2].recurranceDateDataTokens[0];
}
- if (TestTimezone.TimezoneDaylightCollection.size() > 2 &&
- TestTimezone.TimezoneDaylightCollection[2].TimeZoneNameData.size() > 0){
+ if (testTimezone.timeZoneDaylightCollection.size() > 2 &&
+ testTimezone.timeZoneDaylightCollection[2].timeZoneNameData.size() > 0){
- TimeZoneNameData = TestTimezone.TimezoneDaylightCollection[2].TimeZoneNameData[0];
- TimeZoneNameLanguage = TestTimezone.TimezoneDaylightCollection[2].TimeZoneNameLanguage[0];
- TimeZoneNameTokens = TestTimezone.TimezoneDaylightCollection[2].TimeZoneNameTokens[0];
+ timeZoneNameData = testTimezone.timeZoneDaylightCollection[2].timeZoneNameData[0];
+ timeZoneNameLanguage = testTimezone.timeZoneDaylightCollection[2].timeZoneNameLanguage[0];
+ timeZoneNameTokens = testTimezone.timeZoneDaylightCollection[2].timeZoneNameTokens[0];
}
- if (TestTimezone.TimezoneDaylightCollection.size() > 2 &&
- TestTimezone.TimezoneDaylightCollection[2].XTokensData.size() > 0){
+ if (testTimezone.timeZoneDaylightCollection.size() > 2 &&
+ testTimezone.timeZoneDaylightCollection[2].xTokensData.size() > 0){
- XTokensData = TestTimezone.TimezoneDaylightCollection[2].XTokensData[0];
- XTokensDataTokens = TestTimezone.TimezoneDaylightCollection[2].XTokensDataTokens[0];
+ xTokensData = testTimezone.timeZoneDaylightCollection[2].xTokensData[0];
+ xTokensDataTokens = testTimezone.timeZoneDaylightCollection[2].xTokensDataTokens[0];
}
- ASSERT_EQ("20160206T020000", DateTimeStartData);
- ASSERT_EQ("MEEP=MOO", DateTimeStartTokens);
- ASSERT_EQ("-0400", TimeZoneOffsetToData);
- ASSERT_EQ("EXAMPLE=DATA", TimeZoneOffsetToTokens);
- ASSERT_EQ("-0500", TimeZoneOffsetFromData);
- ASSERT_EQ("LETS=GO", TimeZoneOffsetFromTokens);
+ ASSERT_EQ("20160206T020000", dateTimeStartData);
+ ASSERT_EQ("MEEP=MOO", dateTimeStartTokens);
+ ASSERT_EQ("-0400", timeZoneOffsetToData);
+ ASSERT_EQ("EXAMPLE=DATA", timeZoneOffsetToTokens);
+ ASSERT_EQ("-0500", timeZoneOffsetFromData);
+ ASSERT_EQ("LETS=GO", timeZoneOffsetFromTokens);
- ASSERT_EQ("Example timezone comment.", CommentList);
- ASSERT_EQ("null:nodata", CommentListAltRep);
- ASSERT_EQ("kw", CommentListLanguage);
- ASSERT_EQ("YO=YOYOS", CommentListTokens);
+ ASSERT_EQ("Example timezone comment.", commentList);
+ ASSERT_EQ("null:nodata", commentListAltRep);
+ ASSERT_EQ("kw", commentListLanguage);
+ ASSERT_EQ("YO=YOYOS", commentListTokens);
- ASSERT_EQ("FREQ=DAILY;COUNT=10", RecurranceRuleData);
- ASSERT_EQ("YAK=YES", RecurranceRuleDataTokens);
+ ASSERT_EQ("FREQ=DAILY;COUNT=10", recurranceRuleData);
+ ASSERT_EQ("YAK=YES", recurranceRuleDataTokens);
- ASSERT_EQ("20160205,20160207,20160216,20160305", RecurranceDateData);
- ASSERT_EQ("DATE", RecurranceDateValue);
- ASSERT_EQ("Europe/Truro", RecurranceDateDataTimeZoneParam);
- ASSERT_EQ("BEEP=BOOP", RecurranceDateDataTokens);
+ ASSERT_EQ("20160205,20160207,20160216,20160305", recurranceDateData);
+ ASSERT_EQ("DATE", recurranceDateValue);
+ ASSERT_EQ("Europe/Truro", recurranceDateDataTimeZoneParam);
+ ASSERT_EQ("BEEP=BOOP", recurranceDateDataTokens);
- ASSERT_EQ("Example Timezone Name 1", TimeZoneNameData);
- ASSERT_EQ("en", TimeZoneNameLanguage);
- ASSERT_EQ("NOPE=YES", TimeZoneNameTokens);
+ ASSERT_EQ("Example Timezone Name 1", timeZoneNameData);
+ ASSERT_EQ("en", timeZoneNameLanguage);
+ ASSERT_EQ("NOPE=YES", timeZoneNameTokens);
- ASSERT_EQ("Example Timezone Name 1", TimeZoneNameData);
- ASSERT_EQ("en", TimeZoneNameLanguage);
+ ASSERT_EQ("Example Timezone Name 1", timeZoneNameData);
+ ASSERT_EQ("en", timeZoneNameLanguage);
- ASSERT_EQ("Meep", XTokensData);
- ASSERT_EQ("X-MOO", XTokensDataTokens);
+ ASSERT_EQ("Meep", xTokensData);
+ ASSERT_EQ("X-MOO", xTokensDataTokens);
- XTokensData.clear();
- XTokensDataTokens.clear();
+ xTokensData.clear();
+ xTokensDataTokens.clear();
- if (TestTimezone.TimezoneDaylightCollection.size() > 2 &&
- TestTimezone.TimezoneDaylightCollection[2].XTokensData.size() > 1){
+ if (testTimezone.timeZoneDaylightCollection.size() > 2 &&
+ testTimezone.timeZoneDaylightCollection[2].xTokensData.size() > 1){
- XTokensData = TestTimezone.TimezoneDaylightCollection[2].XTokensData[1];
- XTokensDataTokens = TestTimezone.TimezoneDaylightCollection[2].XTokensDataTokens[1];
+ xTokensData = testTimezone.timeZoneDaylightCollection[2].xTokensData[1];
+ xTokensDataTokens = testTimezone.timeZoneDaylightCollection[2].xTokensDataTokens[1];
}
- ASSERT_EQ("Moop", XTokensData);
- ASSERT_EQ("X-MOO", XTokensDataTokens);
+ ASSERT_EQ("Moop", xTokensData);
+ ASSERT_EQ("X-MOO", xTokensDataTokens);
- XTokensData.clear();
- XTokensDataTokens.clear();
+ xTokensData.clear();
+ xTokensDataTokens.clear();
- if (TestTimezone.TimezoneDaylightCollection.size() > 2 &&
- TestTimezone.TimezoneDaylightCollection[2].XTokensData.size() > 2){
+ if (testTimezone.timeZoneDaylightCollection.size() > 2 &&
+ testTimezone.timeZoneDaylightCollection[2].xTokensData.size() > 2){
- XTokensData = TestTimezone.TimezoneDaylightCollection[2].XTokensData[2];
- XTokensDataTokens = TestTimezone.TimezoneDaylightCollection[2].XTokensDataTokens[2];
+ xTokensData = testTimezone.timeZoneDaylightCollection[2].xTokensData[2];
+ xTokensDataTokens = testTimezone.timeZoneDaylightCollection[2].xTokensDataTokens[2];
}
- ASSERT_EQ("Zaap", XTokensData);
- ASSERT_EQ("X-MOO;MEEP=YIKES", XTokensDataTokens);
+ ASSERT_EQ("Zaap", xTokensData);
+ ASSERT_EQ("X-MOO;MEEP=YIKES", xTokensDataTokens);
- XTokensData.clear();
- XTokensDataTokens.clear();
+ xTokensData.clear();
+ xTokensDataTokens.clear();
- if (TestTimezone.TimezoneDaylightCollection.size() > 2 &&
- TestTimezone.TimezoneDaylightCollection[2].XTokensData.size() > 3){
+ if (testTimezone.timeZoneDaylightCollection.size() > 2 &&
+ testTimezone.timeZoneDaylightCollection[2].xTokensData.size() > 3){
- XTokensData = TestTimezone.TimezoneDaylightCollection[2].XTokensData[3];
- XTokensDataTokens = TestTimezone.TimezoneDaylightCollection[2].XTokensDataTokens[3];
+ xTokensData = testTimezone.timeZoneDaylightCollection[2].xTokensData[3];
+ xTokensDataTokens = testTimezone.timeZoneDaylightCollection[2].xTokensDataTokens[3];
}
- ASSERT_EQ("Fork", XTokensData);
- ASSERT_EQ("X-ITEM", XTokensDataTokens);
+ ASSERT_EQ("Fork", xTokensData);
+ ASSERT_EQ("X-ITEM", xTokensDataTokens);
- XTokensData.clear();
- XTokensDataTokens.clear();
+ xTokensData.clear();
+ xTokensDataTokens.clear();
- if (TestTimezone.TimezoneDaylightCollection.size() > 2 &&
- TestTimezone.TimezoneDaylightCollection[2].XTokensData.size() > 4){
+ if (testTimezone.timeZoneDaylightCollection.size() > 2 &&
+ testTimezone.timeZoneDaylightCollection[2].xTokensData.size() > 4){
- XTokensData = TestTimezone.TimezoneDaylightCollection[2].XTokensData[4];
- XTokensDataTokens = TestTimezone.TimezoneDaylightCollection[2].XTokensDataTokens[4];
+ xTokensData = testTimezone.timeZoneDaylightCollection[2].xTokensData[4];
+ xTokensDataTokens = testTimezone.timeZoneDaylightCollection[2].xTokensDataTokens[4];
}
- ASSERT_EQ("Spoon", XTokensData);
- ASSERT_EQ("X-ITEM", XTokensDataTokens);
+ ASSERT_EQ("Spoon", xTokensData);
+ ASSERT_EQ("X-ITEM", xTokensDataTokens);
- XTokensData.clear();
- XTokensDataTokens.clear();
+ xTokensData.clear();
+ xTokensDataTokens.clear();
- if (TestTimezone.TimezoneDaylightCollection.size() > 2 &&
- TestTimezone.TimezoneDaylightCollection[2].XTokensData.size() > 5){
+ if (testTimezone.timeZoneDaylightCollection.size() > 2 &&
+ testTimezone.timeZoneDaylightCollection[2].xTokensData.size() > 5){
- XTokensData = TestTimezone.TimezoneDaylightCollection[2].XTokensData[5];
- XTokensDataTokens = TestTimezone.TimezoneDaylightCollection[2].XTokensDataTokens[5];
+ xTokensData = testTimezone.timeZoneDaylightCollection[2].xTokensData[5];
+ xTokensDataTokens = testTimezone.timeZoneDaylightCollection[2].xTokensDataTokens[5];
}
- ASSERT_EQ("Knife", XTokensData);
- ASSERT_EQ("X-ITEM;DIRTY=NO", XTokensDataTokens);
+ ASSERT_EQ("Knife", xTokensData);
+ ASSERT_EQ("X-ITEM;DIRTY=NO", xTokensDataTokens);
- XTokensData.clear();
- XTokensDataTokens.clear();
+ xTokensData.clear();
+ xTokensDataTokens.clear();
- if (TestTimezone.TimezoneDaylightCollection.size() > 2 &&
- TestTimezone.TimezoneDaylightCollection[2].XTokensData.size() > 6){
+ if (testTimezone.timeZoneDaylightCollection.size() > 2 &&
+ testTimezone.timeZoneDaylightCollection[2].xTokensData.size() > 6){
- XTokensData = TestTimezone.TimezoneDaylightCollection[2].XTokensData[6];
- XTokensDataTokens = TestTimezone.TimezoneDaylightCollection[2].XTokensDataTokens[6];
+ xTokensData = testTimezone.timeZoneDaylightCollection[2].xTokensData[6];
+ xTokensDataTokens = testTimezone.timeZoneDaylightCollection[2].xTokensDataTokens[6];
}
- ASSERT_EQ("1", XTokensData);
- ASSERT_EQ("X-NOPE", XTokensDataTokens);
+ ASSERT_EQ("1", xTokensData);
+ ASSERT_EQ("X-NOPE", xTokensDataTokens);
- XTokensData.clear();
- XTokensDataTokens.clear();
+ xTokensData.clear();
+ xTokensDataTokens.clear();
- if (TestTimezone.TimezoneDaylightCollection.size() > 2 &&
- TestTimezone.TimezoneDaylightCollection[2].XTokensData.size() > 7){
+ if (testTimezone.timeZoneDaylightCollection.size() > 2 &&
+ testTimezone.timeZoneDaylightCollection[2].xTokensData.size() > 7){
- XTokensData = TestTimezone.TimezoneDaylightCollection[2].XTokensData[7];
- XTokensDataTokens = TestTimezone.TimezoneDaylightCollection[2].XTokensDataTokens[7];
+ xTokensData = testTimezone.timeZoneDaylightCollection[2].xTokensData[7];
+ xTokensDataTokens = testTimezone.timeZoneDaylightCollection[2].xTokensDataTokens[7];
}
- ASSERT_EQ("2", XTokensData);
- ASSERT_EQ("X-NOPE", XTokensDataTokens);
+ ASSERT_EQ("2", xTokensData);
+ ASSERT_EQ("X-NOPE", xTokensDataTokens);
- XTokensData.clear();
- XTokensDataTokens.clear();
+ xTokensData.clear();
+ xTokensDataTokens.clear();
- if (TestTimezone.TimezoneDaylightCollection.size() > 2 &&
- TestTimezone.TimezoneDaylightCollection[2].XTokensData.size() > 8){
+ if (testTimezone.timeZoneDaylightCollection.size() > 2 &&
+ testTimezone.timeZoneDaylightCollection[2].xTokensData.size() > 8){
- XTokensData = TestTimezone.TimezoneDaylightCollection[2].XTokensData[8];
- XTokensDataTokens = TestTimezone.TimezoneDaylightCollection[2].XTokensDataTokens[8];
+ xTokensData = testTimezone.timeZoneDaylightCollection[2].xTokensData[8];
+ xTokensDataTokens = testTimezone.timeZoneDaylightCollection[2].xTokensDataTokens[8];
}
- ASSERT_EQ("3", XTokensData);
- ASSERT_EQ("X-NOPE;LONG=YES", XTokensDataTokens);
+ ASSERT_EQ("3", xTokensData);
+ ASSERT_EQ("X-NOPE;LONG=YES", xTokensDataTokens);
}
\ No newline at end of file
TEST(iCalendarSaveTimezone, SaveTimezoneTests){
- CalendarTimezoneObject TestTimezone;
- CalendarTimezoneObject TestTimezone2;
+ CalendarTimezoneObject testTimezone;
+ CalendarTimezoneObject testTimezone2;
// Load the first test timezone.
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestTimezone.LoadFile("iCalendarTimezone-Load1.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestTimezone.ValidBaseObject());
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTimezone.LoadFile("iCalendarTimezone-Load1.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testTimezone.ValidBaseObject());
- ASSERT_EQ(CALENDAROBJECTSAVE_CANNOTOPEN, TestTimezone.SaveFile("/stupidfilelocation/dontsavehere.ics"));
+ ASSERT_EQ(CALENDAROBJECTSAVE_CANNOTOPEN, testTimezone.SaveFile("/stupidfilelocation/dontsavehere.ics"));
// Save the data to a string and compare the data.
// First contact file.
- std::string SaveDataComparison = "BEGIN:VCALENDAR\n"
+ std::string saveDataComparison = "BEGIN:VCALENDAR\n"
"VERSION:2.0\n"
"PRODID:-//Xestia//Calendar Unit Testing//KW\n"
"BEGIN:VTIMEZONE\n"
"END:VTIMEZONE\n"
"END:VCALENDAR";
- std::string SaveData;
+ std::string saveData;
- TestTimezone.SaveString(&SaveData);
+ testTimezone.SaveString(&saveData);
- ASSERT_EQ(SaveDataComparison, SaveData);
+ ASSERT_EQ(saveDataComparison, saveData);
// Process the second calendar item.
- ASSERT_EQ(CALENDAROBJECTLOAD_OK, TestTimezone2.LoadFile("iCalendarTimezone-Load2.vcf"));
- ASSERT_EQ(CALENDAROBJECTVALID_OK, TestTimezone2.ValidBaseObject());
+ ASSERT_EQ(CALENDAROBJECTLOAD_OK, testTimezone2.LoadFile("iCalendarTimezone-Load2.vcf"));
+ ASSERT_EQ(CALENDAROBJECTVALID_OK, testTimezone2.ValidBaseObject());
- SaveData.clear();
+ saveData.clear();
- TestTimezone2.SaveString(&SaveData);
+ testTimezone2.SaveString(&saveData);
- SaveDataComparison = "BEGIN:VCALENDAR\n"
+ saveDataComparison = "BEGIN:VCALENDAR\n"
"VERSION:2.0\n"
"PRODID:-//Xestia//Calendar Unit Testing//KW\n"
"BEGIN:VTIMEZONE\n"
"END:VTIMEZONE\n"
"END:VCALENDAR";
- ASSERT_EQ(SaveDataComparison, SaveData);
+ ASSERT_EQ(saveDataComparison, saveData);
}
\ No newline at end of file
// Load the connection settings.
- CalDAVConnectionData ConnNormal;
- ProcessConnectionDataFileResult DataFileResult;
- bool ValidDataNormal = false;
+ CalDAVConnectionData connNormal;
+ ProcessConnectionDataFileResult dataFileResult;
+ bool validDataNormal = false;
- DataFileResult = ProcessConnectionDataFile("caldavtest.auth", &ConnNormal);
- if (DataFileResult == PROCESSCONNECTIONDATAFILE_OK){
- ValidDataNormal = true;
+ dataFileResult = ProcessConnectionDataFile("caldavtest.auth", &connNormal);
+ if (dataFileResult == PROCESSCONNECTIONDATAFILE_OK){
+ validDataNormal = true;
} else {
// Cannot read the caldavtest.auth file properly.
// Connect to the server and create
// the calendar.
- string ServerAddress = "";
- string ServerUserPass = "";
+ string serverAddress = "";
+ string serverUserPass = "";
// Setup the server address.
- string CalendarName = "Unit Testing Calendar";
- string CalendarShortName = "unittestcal";
+ string calendarName = "Unit Testing Calendar";
+ string calendarShortName = "unittestcal";
- PopulateCalDAV.SetupConnectionData(&ConnNormal);
+ populateCalDAV.setupConnectionData(&ConnNormal);
- CalDAVServerResult ServerResult;
+ CalDAVServerResult serverResult;
- ServerResult = PopulateCalDAV.Connect();
+ serverResult = populateCalDAV.Connect();
- if (ServerResult.Code != CURLE_OK){
+ if (serverResult.Code != CURLE_OK){
cout << "Error while connecting to the CalDAV server." << endl;
cout << "Xestia Calendar Code: " << ServerResult.Result << endl;
// Get the list of calendars.
- CalDAVCalendarList CalendarList = PopulateCalDAV.GetCalendars();
+ CalDAVCalendarList calendarList = populateCalDAV.GetCalendars();
- if (CalendarList.Name.size() == 0){
+ if (calendarList.name.size() == 0){
cout << "Error while getting the list of calendars." << endl;
return;
}
- string CalendarURI = "";
+ string calendarURI = "";
// Look for the Unit testing calendar.
- for (std::map<int,string>::iterator CalNameIter = CalendarList.Name.begin();
- CalNameIter != CalendarList.Name.end(); CalNameIter++){
+ for (std::map<int,string>::iterator calNameIter = calendarList.name.begin();
+ calNameIter != calendarList.Name.end(); calNameIter++){
- if (CalNameIter->second == "Unit Testing Calendar"){
- CalendarURI = CalendarList.HREF.find(CalNameIter->first)->second;
+ if (calNameIter->second == "Unit Testing Calendar"){
+ calendarURI = calendarList.href.find(calNameIter->first)->second;
break;
}
}
- if (CalendarURI == ""){
+ if (calendarURI == ""){
cout << "Error while getting the unit testing calendar URI" << endl;
return;
// Delete the previous calendar.
- ServerResult = PopulateCalDAV.DeleteCalendar(&CalendarURI);
+ serverResult = PopulateCalDAV.DeleteCalendar(&calendarURI);
- if (ServerResult.Code != CURLE_OK){
+ if (serverResult.code != CURLE_OK){
cout << "Error while deleting a calendar." << endl;
- cout << "Xestia Calendar Code: " << ServerResult.Result << endl;
- cout << "cURL Code: " << ServerResult.Code << endl;
- cout << "HTTP Code: " << ServerResult.HTTPCode << endl;
+ cout << "Xestia Calendar Code: " << serverResult.result << endl;
+ cout << "cURL Code: " << serverResult.code << endl;
+ cout << "HTTP Code: " << serverResult.httpCode << endl;
return;
}
// Create the calendar.
- ServerResult = PopulateCalDAV.AddCalendar(&CalendarName, &CalendarShortName);
-
- if (ServerResult.Code != CURLE_OK){
+ serverResult = populateCalDAV.AddCalendar(&calendarName, &calendarShortName);
+
+ if (serverResult.Code != CURLE_OK){
cout << "Error while adding a calendar." << endl;
- cout << "Xestia Calendar Code: " << ServerResult.Result << endl;
- cout << "cURL Code: " << ServerResult.Code << endl;
- cout << "HTTP Code: " << ServerResult.HTTPCode << endl;
+ cout << "Xestia Calendar Code: " << serverResult.result << endl;
+ cout << "cURL Code: " << serverResult.code << endl;
+ cout << "HTTP Code: " << serverResult.httpCode << endl;
return;
}
// Get the list of calendars with the new calendar added.
- CalendarList = PopulateCalDAV.GetCalendars();
+ calendarList = populateCalDAV.GetCalendars();
- if (CalendarList.Name.size() == 0){
+ if (calendarList.name.size() == 0){
cout << "Error while getting the list of calendars." << endl;
return;
}
-
- CalendarURI = "";
+
+ calendarURI = "";
// Look for the Unit testing calendar.
- for (std::map<int,string>::iterator CalNameIter = CalendarList.Name.begin();
- CalNameIter != CalendarList.Name.end(); CalNameIter++){
+ for (std::map<int,string>::iterator calNameIter = calendarList.name.begin();
+ calNameIter != calendarList.Name.end(); calNameIter++){
- if (CalNameIter->second == "Unit Testing Calendar"){
- CalendarURI = CalendarList.HREF.find(CalNameIter->first)->second;
+ if (calNameIter->second == "Unit Testing Calendar"){
+ calendarURI = calendarList.href.find(calNameIter->first)->second;
break;
}
}
- if (CalendarURI == ""){
+ if (calendarURI == ""){
cout << "Error while getting the unit testing calendar URI" << endl;
return;
// Create five entries.
- string EntryUUIDs[5] = { "XC-UT1", "XC-UT2", "XC-UT3", "XC-UT4", "XC-UT5" };
- string EntryFilename[5] = { "xc-ut1.ics", "xc-ut2.ics", "xc-ut3.ics", "xc-ut4.ics", "xc-ut5.ics" };
- string EntryData[5] = {
+ string entryUUIDs[5] = { "XC-UT1", "XC-UT2", "XC-UT3", "XC-UT4", "XC-UT5" };
+ string entryFilename[5] = { "xc-ut1.ics", "xc-ut2.ics", "xc-ut3.ics", "xc-ut4.ics", "xc-ut5.ics" };
+ string entryData[5] = {
"BEGIN:VCALENDAR\n"
"VERSION:2.0\n"
// Place the entries into the calendar.
- string CalendarEntryURI = "";
+ string calendarEntryURI = "";
- for (int EntrySeek = 0; EntrySeek < 5; EntrySeek++){
+ for (int entrySeek = 0; entrySeek < 5; entrySeek++){
- CalendarEntryURI = CalendarURI;
- CalendarEntryURI += EntryFilename[EntrySeek];
+ calendarEntryURI = calendarURI;
+ calendarEntryURI += entryFilename[entrySeek];
- ServerResult = PopulateCalDAV.AddEntry(&CalendarEntryURI, &EntryData[EntrySeek]);
+ serverResult = PopulateCalDAV.AddEntry(&calendarEntryURI, &entryData[entrySeek]);
- if (ServerResult.Code != CURLE_OK){
+ if (serverResult.code != CURLE_OK){
cout << "Error while adding an entry to the unit testing calendar." << endl;
- cout << "Xestia Calendar Code: " << ServerResult.Result << endl;
- cout << "cURL Code: " << ServerResult.Code << endl;
- cout << "HTTP Code: " << ServerResult.HTTPCode << endl;
- cout << "URI address: " << CalendarEntryURI << endl;
+ cout << "Xestia Calendar Code: " << serverResult.result << endl;
+ cout << "cURL Code: " << serverResult.code << endl;
+ cout << "HTTP Code: " << serverResult.httpCode << endl;
+ cout << "URI address: " << calendarEntryURI << endl;
return;
}
- CalendarEntryURI.clear();
+ calendarEntryURI.clear();
}
void runextramenu(){
- bool ExitEnabled = false;
- std::string StringOption = "";
- int TestResult = 0;
+ bool exitEnabled = false;
+ std::string stringOption = "";
+ int testResult = 0;
- while(ExitEnabled == false){
+ while(exitEnabled == false){
printextramenu();
// Get user input.
std::cout << "Select Option: ";
- std::cin >> StringOption;
+ std::cin >> stringOption;
- int IntOption = -1;
+ int intOption = -1;
// Check if input is a number.
try{
- IntOption = stoi(StringOption);
+ intOption = stoi(stringOption);
}
// Return to the top of the while statement if input
// Find which option has been selected from the
// input.
- switch(IntOption){
+ switch(intOption){
case EXTRA_POPULATECALDAV:
printn("Populating CalDAV calendar...");
printn("Note: Unit testing is currently in development");
printn("");
- bool ExitEnabled = false;
- std::string StringOption = "";
- int TestResult = 0;
+ bool exitEnabled = false;
+ std::string stringOption = "";
+ int testResult = 0;
- while(ExitEnabled == false){
+ while(exitEnabled == false){
printmenu();
// Get user input.
std::cout << "Select Option: ";
- std::cin >> StringOption;
+ std::cin >> stringOption;
- int IntOption = -1;
+ int intOption = -1;
// Check if input is a number.
try{
- IntOption = stoi(StringOption);
+ intOption = stoi(stringOption);
}
// Return to the top of the while statement if input
case TESTS_ICALLOADEVENT:
printn("Running iCalendar Event Component tests...");
::testing::GTEST_FLAG(filter) = "iCalendarEvent*";
- TestResult = RUN_ALL_TESTS();
+ testResult = RUN_ALL_TESTS();
break;
case TESTS_ICALSAVEEVENT:
printn("Running iCalendar Event Component Save tests...");
::testing::GTEST_FLAG(filter) = "iCalendarSaveEvent*";
- TestResult = RUN_ALL_TESTS();
+ testResult = RUN_ALL_TESTS();
break;
case TESTS_ICALLOADTODO:
printn("Running iCalendar Task Component tests...");
::testing::GTEST_FLAG(filter) = "iCalendarTask*";
- TestResult = RUN_ALL_TESTS();
+ testResult = RUN_ALL_TESTS();
break;
case TESTS_ICALSAVETODO:
printn("Running iCalendar Task Component Save tests...");
::testing::GTEST_FLAG(filter) = "iCalendarSaveTask*";
- TestResult = RUN_ALL_TESTS();
+ testResult = RUN_ALL_TESTS();
break;
case TESTS_ICALLOADJOURNAL:
printn("Running iCalendar Journal Component tests...");
::testing::GTEST_FLAG(filter) = "iCalendarJournal*";
- TestResult = RUN_ALL_TESTS();
+ testResult = RUN_ALL_TESTS();
break;
case TESTS_ICALSAVEJOURNAL:
printn("Running iCalendar Journal Component Save tests...");
::testing::GTEST_FLAG(filter) = "iCalendarSaveJournal*";
- TestResult = RUN_ALL_TESTS();
+ testResult = RUN_ALL_TESTS();
break;
case TESTS_ICALLOADFREEBUSY:
printn("Running iCalendar Free Busy Component tests...");
::testing::GTEST_FLAG(filter) = "iCalendarFreeBusy*";
- TestResult = RUN_ALL_TESTS();
+ testResult = RUN_ALL_TESTS();
break;
case TESTS_ICALSAVEFREEBUSY:
printn("Running iCalendar Free Busy Component Save tests...");
::testing::GTEST_FLAG(filter) = "iCalendarSaveFreeBusy*";
- TestResult = RUN_ALL_TESTS();
+ testResult = RUN_ALL_TESTS();
break;
case TESTS_ICALLOADTIMEZONE:
printn("Running iCalendar Timezone Component tests...");
::testing::GTEST_FLAG(filter) = "iCalendarTimezone*";
- TestResult = RUN_ALL_TESTS();
+ testResult = RUN_ALL_TESTS();
break;
case TESTS_ICALSAVETIMEZONE:
printn("Running iCalendar Timezone Component Save tests...");
::testing::GTEST_FLAG(filter) = "iCalendarSaveTimezone*";
- TestResult = RUN_ALL_TESTS();
+ testResult = RUN_ALL_TESTS();
break;
case TESTS_CALENDARDATASTORAGE:
printn("Running Calendar Data Storage tests...");
::testing::GTEST_FLAG(filter) = "CalendarDataStorage*";
- TestResult = RUN_ALL_TESTS();
+ testResult = RUN_ALL_TESTS();
break;
case TESTS_CALDAV:
printn("Running CalDAV tests...");
::testing::GTEST_FLAG(filter) = "CalDAV*";
- TestResult = RUN_ALL_TESTS();
+ testResult = RUN_ALL_TESTS();
break;
case TESTS_COMMONFUNCTIONS:
printn("Running Commmon Functions tests...");
::testing::GTEST_FLAG(filter) = "CommonFunctions*";
- TestResult = RUN_ALL_TESTS();
+ testResult = RUN_ALL_TESTS();
break;
case TESTS_EXTRA:
runextramenu();
ProcessConnectionDataFileResult ProcessConnectionDataFile(string DataFilename,
CalDAVConnectionData *ConnData){
- ProcessConnectionDataFileResult ProcessResult = PROCESSCONNECTIONDATAFILE_UNITTESTFAIL;
+ ProcessConnectionDataFileResult processResult = PROCESSCONNECTIONDATAFILE_UNITTESTFAIL;
// Check if the file exists and return
// PROCESSCONNECTIONDATAFILE_MISSING if not.
- if (!FileExists(DataFilename)){
+ if (!FileExists(dataFilename)){
return PROCESSCONNECTIONDATAFILE_MISSING;
}
- ifstream FileStream;
- string ReceivedStringData = "";
+ ifstream fileStream;
+ string receivedStringData = "";
- FileStream.open(DataFilename, ifstream::in);
+ fileStream.open(dataFilename, ifstream::in);
- if (FileStream.rdstate() & ifstream::failbit){
+ if (fileStream.rdstate() & ifstream::failbit){
return PROCESSCONNECTIONDATAFILE_CANNOTOPEN;
}
- if (FileStream.rdstate() & ifstream::badbit){
+ if (fileStream.rdstate() & ifstream::badbit){
return PROCESSCONNECTIONDATAFILE_CANNOTOPEN;
}
// Process the file.
- char *BufferRead = new char[256];
+ char *bufferRead = new char[256];
while (!FileStream.eof()){
- FileStream.getline(BufferRead, 256);
- ReceivedStringData.append(BufferRead);
- ReceivedStringData.append("\n");
+ fileStream.getline(bufferRead, 256);
+ receivedStringData.append(bufferRead);
+ receivedStringData.append("\n");
}
- delete[] BufferRead;
+ delete[] bufferRead;
- bool NewLine = false;
- bool SkipMode = false;
- bool EqualFound = false;
- bool QuoteMode = false;
- bool ServerNameFound = false;
- bool ServerUserFound = false;
- bool ServerPassFound = false;
- bool ServerSSLFound = false;
- bool ServerPortFound = false;
- bool ServerPrefixFound = false;
- char BufferChar = 0;
- int StringDataSize = ReceivedStringData.size();
- int SeekCount = 0;
- string PropertyName;
- string PropertyValue;
+ bool newLine = false;
+ bool skipMode = false;
+ bool equalFound = false;
+ bool quoteMode = false;
+ bool serverNameFound = false;
+ bool serverUserFound = false;
+ bool serverPassFound = false;
+ bool serverSSLFound = false;
+ bool serverPortFound = false;
+ bool serverPrefixFound = false;
+ char bufferChar = 0;
+ int stringDataSize = receivedStringData.size();
+ int seekCount = 0;
+ string propertyName;
+ string propertyValue;
- while (SeekCount < StringDataSize){
+ while (seekCount < stringDataSize){
- if (ReceivedStringData[SeekCount] == '='){
+ if (receivedStringData[seekCount] == '='){
- EqualFound = true;
+ equalFound = true;
- } else if (ReceivedStringData[SeekCount] == '\n'){
+ } else if (receivedStringData[seekCount] == '\n'){
// Newline reached. Check for what type of
// data it is.
// there is a values in the property name
// and property value before doing anything.
- if (EqualFound == true &&
- PropertyName.size() > 0 &&
- PropertyValue.size() > 0){
+ if (equalFound == true &&
+ propertyName.size() > 0 &&
+ propertyValue.size() > 0){
- if (PropertyName == "server" && ServerNameFound == false){
+ if (propertyName == "server" && serverNameFound == false){
// Setup the server hostname.
- ConnData->Hostname = PropertyValue;
- ServerNameFound = true;
+ connData->hostname = propertyValue;
+ serverNameFound = true;
- } else if (PropertyName == "port" && ServerPortFound == false){
+ } else if (propertyName == "port" && serverPortFound == false){
// Setup the server port.
- int PortNum;
- bool PortNumValid = true;
+ int portNum;
+ bool portNumValid = true;
try{
- PortNum = stoi(PropertyValue);
+ portNum = stoi(propertyValue);
}
catch(const invalid_argument &oor){
- PortNumValid = false;
+ portNumValid = false;
}
// Port Number is valid so add to the
// CalDAVConnectionData handle.
- if (PortNumValid == true){
- ConnData->Port = PortNum;
- ServerPortFound = true;
+ if (portNumValid == true){
+ connData->Port = portNum;
+ serverPortFound = true;
}
- } else if (PropertyName == "user" && ServerUserFound == false){
+ } else if (propertyName == "user" && serverUserFound == false){
// Setup the server user.
- ConnData->Username = PropertyValue;
- ServerUserFound = true;
+ connData->username = propertyValue;
+ serverUserFound = true;
- } else if (PropertyName == "pass" && ServerPassFound == false){
+ } else if (propertyName == "pass" && serverPassFound == false){
// Setup the server pass.
- ConnData->Password = PropertyValue;
- ServerPassFound = true;
+ connData->Password = propertyValue;
+ serverPassFound = true;
- } else if (PropertyName == "ssl" && ServerSSLFound == false){
+ } else if (propertyName == "ssl" && serverSSLFound == false){
// Setup the server SSL status.
- if (PropertyValue == "true"){
- ConnData->UseSSL = true;
+ if (propertyValue == "true"){
+ connData->useSSL = true;
} else {
- ConnData->UseSSL = false;
+ connData->useSSL = false;
}
- ServerSSLFound = true;
+ serverSSLFound = true;
- } else if (PropertyName == "prefix" && ServerPrefixFound == false){
+ } else if (propertyName == "prefix" && serverPrefixFound == false){
// Setup the server prefix.
- ConnData->Prefix = PropertyValue;
- ServerPrefixFound = true;
+ connData->prefix = propertyValue;
+ serverPrefixFound = true;
}
// Reset the variables.
- EqualFound = false;
- PropertyName.clear();
- PropertyValue.clear();
+ equalFound = false;
+ propertyName.clear();
+ propertyValue.clear();
} else {
// Property name or value depending on
// if the equal sign has been found.
- BufferChar = ReceivedStringData[SeekCount];
+ bufferChar = receivedStringData[seekCount];
- if (EqualFound == true){
- PropertyValue += BufferChar;
+ if (equalFound == true){
+ propertyValue += bufferChar;
} else {
- PropertyName += BufferChar;
+ propertyName += bufferChar;
}
- BufferChar = 0;
+ bufferChar = 0;
}
- SeekCount++;
+ seekCount++;
}
// Check that the CalDAV connection data object
// contains valid data.
- bool CalDAVConnDataResult = CalDAVObjectValidSettings(ConnData);
+ bool calDAVConnDataResult = CalDAVObjectValidSettings(connData);
- if (CalDAVConnDataResult == false){
- ProcessResult = PROCESSCONNECTIONDATAFILE_INVALID;
+ if (calDAVConnDataResult == false){
+ processResult = PROCESSCONNECTIONDATAFILE_INVALID;
} else {
- ProcessResult = PROCESSCONNECTIONDATAFILE_OK;
+ processResult = PROCESSCONNECTIONDATAFILE_OK;
}
- return ProcessResult;
+ return processResult;
}
\ No newline at end of file
PROCESSCONNECTIONDATAFILE_INVALID
};
-ProcessConnectionDataFileResult ProcessConnectionDataFile(string DataFilename,
- CalDAVConnectionData *ConnData);
+ProcessConnectionDataFileResult ProcessConnectionDataFile(string dataFilename,
+ CalDAVConnectionData *connData);
#endif
\ No newline at end of file