summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Parser/PayloadParsers/UnitTest')
-rw-r--r--Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp
index 2d16636..bfae4f0 100644
--- a/Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp
+++ b/Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp
@@ -10,6 +10,7 @@ class VCardParserTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(VCardParserTest);
CPPUNIT_TEST(testParse_Photo);
+ CPPUNIT_TEST(testParse_Nickname);
CPPUNIT_TEST_SUITE_END();
public:
@@ -34,6 +35,19 @@ class VCardParserTest : public CppUnit::TestFixture
CPPUNIT_ASSERT_EQUAL(String("image/jpeg"), payload->getPhotoType());
CPPUNIT_ASSERT_EQUAL(ByteArray("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"), payload->getPhoto());
}
+
+ void testParse_Nickname() {
+ VCardParser testling;
+ PayloadParserTester parser(&testling);
+
+ CPPUNIT_ASSERT(parser.parse(
+ "<vCard xmlns='vcard-temp'>"
+ "<NICKNAME>mynick</NICKNAME>"
+ "</vCard>"));
+
+ VCard* payload = dynamic_cast<VCard*>(testling.getPayload().get());
+ CPPUNIT_ASSERT_EQUAL(String("mynick"), payload->getNickname());
+ }
};
CPPUNIT_TEST_SUITE_REGISTRATION(VCardParserTest);