Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added unit tests for X-* in iCalendarEvent/ObjectDataTests.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 30 Jan 2016 17:56:36 +0000 (17:56 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 30 Jan 2016 17:56:36 +0000 (17:56 +0000)
source/tests/xestiacalendar_icaleventload.h

index 975e146..31e6ec7 100644 (file)
@@ -890,4 +890,184 @@ TEST(iCalendarEvent, ObjectDataTests){
        ASSERT_EQ("20160520", RecurrenceDate);
        ASSERT_EQ("ZILCH=DATA", RecurrenceTokens);
        
+       // Get the first X-EXAMPLE1 token.
+       
+       std::string XTokenName;
+       std::string XTokenData;
+       
+       if (TestEvent.XTokensData.size() != 0 ){
+       
+               XTokenData = TestEvent.XTokensData[0];
+               
+       }
+
+       if (TestEvent.XTokensData.size() != 0){
+       
+               XTokenName = TestEvent.XTokensDataTokens[0];
+               
+       }
+       
+       ASSERT_EQ("Moo", XTokenData);
+       ASSERT_EQ("X-EXAMPLE1", XTokenName);
+       
+       // Get the second X-EXAMPLE1 token.
+
+       XTokenName.clear();
+       XTokenData.clear();
+       
+       if (TestEvent.XTokensData.size() > 1){
+       
+               XTokenData = TestEvent.XTokensData[1];
+               
+       }
+
+       if (TestEvent.XTokensData.size() > 1){
+       
+               XTokenName = TestEvent.XTokensDataTokens[1];
+               
+       }
+       
+       ASSERT_EQ("Meep", XTokenData);
+       ASSERT_EQ("X-EXAMPLE1;ANIMAL=NOPE", XTokenName);
+       
+       // Get the third X-EXAMPLE1 token.
+
+       XTokenName.clear();
+       XTokenData.clear();
+       
+       if (TestEvent.XTokensData.size() > 2){
+       
+               XTokenData = TestEvent.XTokensData[2];
+               
+       }
+
+       if (TestEvent.XTokensData.size() > 2){
+       
+               XTokenName = TestEvent.XTokensDataTokens[2];
+               
+       }
+       
+       ASSERT_EQ("Meow", XTokenData);
+       ASSERT_EQ("X-EXAMPLE1;ANIMAL=CAT", XTokenName);
+       
+       // Get the first X-EXAMPLE2 token.
+       
+       XTokenName.clear();
+       XTokenData.clear();
+       
+       if (TestEvent.XTokensData.size() > 3){
+       
+               XTokenData = TestEvent.XTokensData[3];
+               
+       }
+
+       if (TestEvent.XTokensData.size() > 3){
+       
+               XTokenName = TestEvent.XTokensDataTokens[3];
+               
+       }
+       
+       ASSERT_EQ("Dish", XTokenData);
+       ASSERT_EQ("X-EXAMPLE2", XTokenName);
+       
+       // Get the second X-EXAMPLE2 token.
+       
+       XTokenName.clear();
+       XTokenData.clear();
+       
+       if (TestEvent.XTokensData.size() > 4){
+       
+               XTokenData = TestEvent.XTokensData[4];
+               
+       }
+
+       if (TestEvent.XTokensData.size() > 4){
+       
+               XTokenName = TestEvent.XTokensDataTokens[4];
+               
+       }
+       
+       ASSERT_EQ("Fork", XTokenData);
+       ASSERT_EQ("X-EXAMPLE2;OBJECT=KITCHEN", XTokenName);
+       
+       // Get the third X-EXAMPLE2 token.
+       
+       XTokenName.clear();
+       XTokenData.clear();
+       
+       if (TestEvent.XTokensData.size() > 5){
+       
+               XTokenData = TestEvent.XTokensData[5];
+               
+       }
+
+       if (TestEvent.XTokensData.size() > 5){
+       
+               XTokenName = TestEvent.XTokensDataTokens[5];
+               
+       }
+       
+       ASSERT_EQ("Table", XTokenData);
+       ASSERT_EQ("X-EXAMPLE2;OBJECT=LIVINGROOM", XTokenName);
+       
+       // Get the X-STATUS token.
+       
+       XTokenName.clear();
+       XTokenData.clear();
+       
+       if (TestEvent.XTokensData.size() > 6){
+       
+               XTokenData = TestEvent.XTokensData[6];
+               
+       }
+
+       if (TestEvent.XTokensData.size() > 6){
+       
+               XTokenName = TestEvent.XTokensDataTokens[6];
+               
+       }
+       
+       ASSERT_EQ("Idle", XTokenData);
+       ASSERT_EQ("X-STATUS;HOLIDAY=YES", XTokenName);
+       
+       // Get the X-TRANSPORT token.
+       
+       XTokenName.clear();
+       XTokenData.clear();
+       
+       if (TestEvent.XTokensData.size() > 7){
+       
+               XTokenData = TestEvent.XTokensData[7];
+               
+       }
+
+       if (TestEvent.XTokensData.size() > 7){
+       
+               XTokenName = TestEvent.XTokensDataTokens[7];
+               
+       }
+       
+       ASSERT_EQ("Private Hire", XTokenData);
+       ASSERT_EQ("X-TRANSPORT;PUBLIC=NO", XTokenName);
+       
+       // Get the X-PHANTOM-STATUS token.
+       
+       XTokenName.clear();
+       XTokenData.clear();
+       
+       if (TestEvent.XTokensData.size() > 8){
+       
+               XTokenData = TestEvent.XTokensData[8];
+               
+       }
+
+       if (TestEvent.XTokensData.size() > 8){
+       
+               XTokenName = TestEvent.XTokensDataTokens[8];
+               
+       }
+       
+       ASSERT_EQ("None", XTokenData);
+       ASSERT_EQ("X-PHANTOM-STATUS;HELP=NONE", XTokenName);
+       
 }
\ No newline at end of file
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy