/* * Copyright (c) 2013 Tobias Markmann * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ /* * Copyright (c) 2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include #include #include #include #include #include #include using namespace Swift; class BlockSerializerTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(BlockSerializerTest); CPPUNIT_TEST(testExample4); CPPUNIT_TEST(testExample6); CPPUNIT_TEST(testExample10); CPPUNIT_TEST_SUITE_END(); public: BlockSerializerTest() {} void testExample4() { BlockSerializer testling("blocklist"); std::shared_ptr blocklist = std::make_shared(); blocklist->addItem(JID("romeo@montague.net")); blocklist->addItem(JID("iago@shakespeare.lit")); CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(blocklist)); } void testExample6() { BlockSerializer testling("block"); std::shared_ptr block = std::make_shared(); block->addItem(JID("romeo@montague.net")); CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(block)); } void testExample10() { BlockSerializer testling("unblock"); std::shared_ptr unblock = std::make_shared(); unblock->addItem(JID("romeo@montague.net")); CPPUNIT_ASSERT_EQUAL(std::string(""), testling.serialize(unblock)); } }; CPPUNIT_TEST_SUITE_REGISTRATION(BlockSerializerTest);