/* * Copyright (c) 2010 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #include #include #include #include #include using namespace Swift; class PrivateStorageSerializerTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(PrivateStorageSerializerTest); CPPUNIT_TEST(testSerialize); CPPUNIT_TEST_SUITE_END(); public: PrivateStorageSerializerTest() {} void testSerialize() { PayloadsSerializer serializer; boost::shared_ptr privateStorage(new PrivateStorage()); boost::shared_ptr storage(new Storage()); Storage::Room room; room.name = "Swift"; room.jid = JID("swift@rooms.swift.im"); room.nick = "Alice"; storage->addRoom(room); privateStorage->setPayload(storage); CPPUNIT_ASSERT_EQUAL(std::string( "" "" "" "Alice" "" "" ""), serializer.serialize(privateStorage)); } }; CPPUNIT_TEST_SUITE_REGISTRATION(PrivateStorageSerializerTest);