diff options
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp')
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp b/Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp index 9320eff..b1b0c45 100644 --- a/Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp +++ b/Swiften/Serializer/PayloadSerializers/UnitTest/InBandRegistrationPayloadSerializerTest.cpp @@ -14,50 +14,50 @@ using namespace Swift; class InBandRegistrationPayloadSerializerTest : public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE(InBandRegistrationPayloadSerializerTest); - CPPUNIT_TEST(testSerialize); - CPPUNIT_TEST(testSerialize_Form); - CPPUNIT_TEST_SUITE_END(); - - public: - void testSerialize() { - InBandRegistrationPayloadSerializer testling; - boost::shared_ptr<InBandRegistrationPayload> registration(new InBandRegistrationPayload()); - registration->setRegistered(true); - - std::string expectedResult = - "<query xmlns=\"jabber:iq:register\">" - "<registered/>" - "</query>"; - - CPPUNIT_ASSERT_EQUAL(expectedResult, testling.serialize(registration)); - } - void testSerialize_Form() { - InBandRegistrationPayloadSerializer testling; - boost::shared_ptr<InBandRegistrationPayload> registration(new InBandRegistrationPayload()); - registration->setInstructions("Use the enclosed form to register."); - - boost::shared_ptr<Form> form(new Form(Form::FormType)); - form->setTitle("Contest Registration"); - - FormField::ref field = boost::make_shared<FormField>(FormField::HiddenType, "jabber:iq:register"); - field->setName("FORM_TYPE"); - form->addField(field); - registration->setForm(form); - - std::string expectedResult = - "<query xmlns=\"jabber:iq:register\">" - "<instructions>Use the enclosed form to register.</instructions>" - "<x type=\"form\" xmlns=\"jabber:x:data\">" - "<title>Contest Registration</title>" - "<field type=\"hidden\" var=\"FORM_TYPE\">" - "<value>jabber:iq:register</value>" - "</field>" - "</x>" - "</query>"; - - CPPUNIT_ASSERT_EQUAL(expectedResult, testling.serialize(registration)); - } + CPPUNIT_TEST_SUITE(InBandRegistrationPayloadSerializerTest); + CPPUNIT_TEST(testSerialize); + CPPUNIT_TEST(testSerialize_Form); + CPPUNIT_TEST_SUITE_END(); + + public: + void testSerialize() { + InBandRegistrationPayloadSerializer testling; + boost::shared_ptr<InBandRegistrationPayload> registration(new InBandRegistrationPayload()); + registration->setRegistered(true); + + std::string expectedResult = + "<query xmlns=\"jabber:iq:register\">" + "<registered/>" + "</query>"; + + CPPUNIT_ASSERT_EQUAL(expectedResult, testling.serialize(registration)); + } + void testSerialize_Form() { + InBandRegistrationPayloadSerializer testling; + boost::shared_ptr<InBandRegistrationPayload> registration(new InBandRegistrationPayload()); + registration->setInstructions("Use the enclosed form to register."); + + boost::shared_ptr<Form> form(new Form(Form::FormType)); + form->setTitle("Contest Registration"); + + FormField::ref field = boost::make_shared<FormField>(FormField::HiddenType, "jabber:iq:register"); + field->setName("FORM_TYPE"); + form->addField(field); + registration->setForm(form); + + std::string expectedResult = + "<query xmlns=\"jabber:iq:register\">" + "<instructions>Use the enclosed form to register.</instructions>" + "<x type=\"form\" xmlns=\"jabber:x:data\">" + "<title>Contest Registration</title>" + "<field type=\"hidden\" var=\"FORM_TYPE\">" + "<value>jabber:iq:register</value>" + "</field>" + "</x>" + "</query>"; + + CPPUNIT_ASSERT_EQUAL(expectedResult, testling.serialize(registration)); + } }; CPPUNIT_TEST_SUITE_REGISTRATION(InBandRegistrationPayloadSerializerTest); |