diff options
Diffstat (limited to 'Swiften/Parser/PayloadParsers/UnitTest/ResourceBindParserTest.cpp')
m--------- | Swiften | 0 | ||||
-rw-r--r-- | Swiften/Parser/PayloadParsers/UnitTest/ResourceBindParserTest.cpp | 38 |
2 files changed, 0 insertions, 38 deletions
diff --git a/Swiften b/Swiften new file mode 160000 +Subproject 8213ba16d0043d2461f4b031c881d61dda5a38c diff --git a/Swiften/Parser/PayloadParsers/UnitTest/ResourceBindParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/ResourceBindParserTest.cpp deleted file mode 100644 index b1b61ef..0000000 --- a/Swiften/Parser/PayloadParsers/UnitTest/ResourceBindParserTest.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/extensions/TestFactoryRegistry.h> - -#include "Swiften/Parser/PayloadParsers/ResourceBindParser.h" -#include "Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h" - -using namespace Swift; - -class ResourceBindParserTest : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE(ResourceBindParserTest); - CPPUNIT_TEST(testParse_JID); - CPPUNIT_TEST(testParse_Resource); - CPPUNIT_TEST_SUITE_END(); - - public: - ResourceBindParserTest() {} - - void testParse_JID() { - PayloadsParserTester parser; - - CPPUNIT_ASSERT(parser.parse("<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><jid>somenode@example.com/someresource</jid></bind>")); - - ResourceBind* payload = dynamic_cast<ResourceBind*>(parser.getPayload().get()); - CPPUNIT_ASSERT_EQUAL(JID("somenode@example.com/someresource"), payload->getJID()); - } - - void testParse_Resource() { - PayloadsParserTester parser; - - CPPUNIT_ASSERT(parser.parse("<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><resource>someresource</resource></bind>")); - - ResourceBind* payload = dynamic_cast<ResourceBind*>(parser.getPayload().get()); - CPPUNIT_ASSERT_EQUAL(String("someresource"), payload->getResource()); - } -}; - -CPPUNIT_TEST_SUITE_REGISTRATION(ResourceBindParserTest); |