From: Steve Brokenshire Date: Sat, 23 Jan 2016 20:50:00 +0000 (+0000) Subject: Added SplitValuesTests and SplitNameValueTests X-Git-Tag: release-0.02~717 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=b143e06514c9b2080505f8057c5df52cb7525dfa;p=xestiacalendar%2F.git Added SplitValuesTests and SplitNameValueTests --- 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