diff options
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp')
m--------- | Swiften | 0 | ||||
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp | 48 |
2 files changed, 0 insertions, 48 deletions
diff --git a/Swiften b/Swiften new file mode 160000 +Subproject 8213ba16d0043d2461f4b031c881d61dda5a38c diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp deleted file mode 100644 index 81fdc09..0000000 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/RosterSerializerTest.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/extensions/TestFactoryRegistry.h> - -#include "Swiften/Serializer/PayloadSerializers/RosterSerializer.h" - -using namespace Swift; - -class RosterSerializerTest : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE(RosterSerializerTest); - CPPUNIT_TEST(testSerialize); - CPPUNIT_TEST_SUITE_END(); - - public: - RosterSerializerTest() {} - - void testSerialize() { - RosterSerializer testling; - boost::shared_ptr<RosterPayload> roster(new RosterPayload()); - - RosterItemPayload item1; - item1.setJID(JID("foo@bar.com")); - item1.setName("Foo @ Bar"); - item1.setSubscription(RosterItemPayload::From); - item1.addGroup("Group 1"); - item1.addGroup("Group 2"); - item1.setSubscriptionRequested(); - roster->addItem(item1); - - RosterItemPayload item2; - item2.setJID(JID("baz@blo.com")); - item2.setName("Baz"); - roster->addItem(item2); - - String expectedResult = - "<query xmlns=\"jabber:iq:roster\">" - "<item ask=\"subscribe\" jid=\"foo@bar.com\" name=\"Foo @ Bar\" subscription=\"from\">" - "<group>Group 1</group>" - "<group>Group 2</group>" - "</item>" - "<item jid=\"baz@blo.com\" name=\"Baz\" subscription=\"none\"/>" - "</query>"; - - CPPUNIT_ASSERT_EQUAL(expectedResult, testling.serialize(roster)); - } -}; - -CPPUNIT_TEST_SUITE_REGISTRATION(RosterSerializerTest); |