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());
+
// Tests for the first VALARM property.
std::string ActionData;
std::string TriggerValue;
std::string TriggerTokens;
+ std::string DurationData;
+ std::string DurationTokens;
+
+ std::string RepeatData;
+ std::string RepeatTokens;
+
+ std::string XTokenData;
+ std::string XTokenName;
+
if (TestEvent.CalendarAlarmData.size() > 0){
ActionData = TestEvent.CalendarAlarmData[0].AlarmAction;
TriggerValue = TestEvent.CalendarAlarmData[0].TriggerValue;
TriggerTokens = TestEvent.CalendarAlarmData[0].TriggerTokens;
+ DurationData = TestEvent.CalendarAlarmData[0].DurationData;
+ DurationTokens = TestEvent.CalendarAlarmData[0].DurationTokens;
+
+ RepeatData = TestEvent.CalendarAlarmData[0].RepeatData;
+ RepeatTokens = TestEvent.CalendarAlarmData[0].RepeatTokens;
+
}
ASSERT_EQ("AUDIO", ActionData);
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("PT5M", RepeatData);
+ ASSERT_EQ("NEVER=SLEEP", RepeatTokens);
+
+ // Test the first X-Token.
+
+ if (TestEvent.CalendarAlarmData[0].XTokensData.size() > 0){
+
+ XTokenData = TestEvent.CalendarAlarmData[0].XTokensData[0];
+ XTokenName = TestEvent.CalendarAlarmData[0].XTokensDataTokens[0];
+
+ }
-}
\ No newline at end of file
+ ASSERT_EQ("Example Data 1", XTokenData);
+ ASSERT_EQ("X-EXAMPLE1;YAY=YES", XTokenName);
+
+ // Test the second X-Token.
+
+ XTokenData.clear();
+ XTokenName.clear();
+
+ if (TestEvent.CalendarAlarmData[0].XTokensData.size() > 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);
+
+ // Test the third X-Token.
+
+ XTokenData.clear();
+ XTokenName.clear();
+
+ if (TestEvent.CalendarAlarmData[0].XTokensData.size() > 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);
+
+}