From b143e06514c9b2080505f8057c5df52cb7525dfa Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sat, 23 Jan 2016 20:50:00 +0000 Subject: [PATCH] Added SplitValuesTests and SplitNameValueTests --- source/tests/xestiacalendar_commonfunctions.h | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/source/tests/xestiacalendar_commonfunctions.h b/source/tests/xestiacalendar_commonfunctions.h index ca7269b..a332228 100644 --- a/source/tests/xestiacalendar_commonfunctions.h +++ b/source/tests/xestiacalendar_commonfunctions.h @@ -153,4 +153,30 @@ TEST(CommonFunctions, ProcessTextVectorsTests){ ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "RELATED")); +} + +TEST(CommonFunctions, SplitValuesTests){ + + map TextExample1TestResult; + + 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")); + +} + +TEST(CommonFunctions, SplitNameValueTests){ + + PropertyNameValue NameValueResult; + + NameValueResult = SplitNameValue("TEST=OK"); + + string PropertyName = NameValueResult.Name; + string PropertyValue = NameValueResult.Value; + + ASSERT_EQ(PropertyName, "TEST"); + ASSERT_EQ(PropertyValue, "OK"); + } \ No newline at end of file -- 2.39.5