From 0dbb1bdc9ec1a04f5e57706964f8939ce658785d Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 31 Jan 2016 11:15:31 +0000 Subject: [PATCH] Added unit tests for DESCRIPTION in iCalendarTask/ObjectDataTests. --- source/tests/xestiacalendar_icaltaskload.h | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/source/tests/xestiacalendar_icaltaskload.h b/source/tests/xestiacalendar_icaltaskload.h index e67be93..0b06238 100644 --- a/source/tests/xestiacalendar_icaltaskload.h +++ b/source/tests/xestiacalendar_icaltaskload.h @@ -59,4 +59,32 @@ TEST(iCalendarTask, ObjectDataTests){ 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; + + if (TestTask.DescriptionList.begin() != TestTask.DescriptionList.end()){ + DescriptionData = TestTask.DescriptionList[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.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); + } \ No newline at end of file -- 2.39.5