X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;ds=inline;f=source%2Ftests%2Fxestiacalendar_commonfunctions.h;h=85ef33e164ac1776d13607438e5ca3331d75684e;hb=054065cd3792f4347f85f765c7d3d58db473c3f4;hp=ca7269b58345aaa36b26b1d7704bea0964fe1996;hpb=c3a43f492e9eb3003693d165a8c057b2a89f9d64;p=xestiacalendar%2F.git
diff --git a/source/tests/xestiacalendar_commonfunctions.h b/source/tests/xestiacalendar_commonfunctions.h
index ca7269b..85ef33e 100644
--- a/source/tests/xestiacalendar_commonfunctions.h
+++ b/source/tests/xestiacalendar_commonfunctions.h
@@ -1,3 +1,21 @@
+// xestiacalendar_commonfunctions.h - Xestia Calendar Common Functions Unit Tests
+//
+// (c) 2016 Xestia Software Development.
+//
+// This file is part of Xestia Calendar.
+//
+// Xestia Address Book is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by the
+// Free Software Foundation, version 3 of the license.
+//
+// Xestia Address Book is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with Xestia Calendar. If not, see
+
#include "../common/file.h"
#include "../common/text.h"
@@ -153,4 +171,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