summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Parser/UnitTest/PresenceParserTest.cpp')
m---------Swiften0
-rw-r--r--Swiften/Parser/UnitTest/PresenceParserTest.cpp110
2 files changed, 0 insertions, 110 deletions
diff --git a/Swiften b/Swiften
new file mode 160000
+Subproject 8213ba16d0043d2461f4b031c881d61dda5a38c
diff --git a/Swiften/Parser/UnitTest/PresenceParserTest.cpp b/Swiften/Parser/UnitTest/PresenceParserTest.cpp
deleted file mode 100644
index 5305161..0000000
--- a/Swiften/Parser/UnitTest/PresenceParserTest.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-#include <cppunit/extensions/HelperMacros.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-
-#include "Swiften/Parser/PresenceParser.h"
-#include "Swiften/Parser/PayloadParserFactoryCollection.h"
-#include "Swiften/Parser/UnitTest/StanzaParserTester.h"
-
-using namespace Swift;
-
-class PresenceParserTest : public CppUnit::TestFixture
-{
- CPPUNIT_TEST_SUITE(PresenceParserTest);
- CPPUNIT_TEST(testParse_Available);
- CPPUNIT_TEST(testParse_Unavailable);
- CPPUNIT_TEST(testParse_Subscribe);
- CPPUNIT_TEST(testParse_Subscribed);
- CPPUNIT_TEST(testParse_Unsubscribe);
- CPPUNIT_TEST(testParse_Unsubscribed);
- CPPUNIT_TEST(testParse_Probe);
- CPPUNIT_TEST(testParse_Error);
- CPPUNIT_TEST_SUITE_END();
-
- public:
- PresenceParserTest() {}
-
- void setUp() {
- factoryCollection_ = new PayloadParserFactoryCollection();
- }
-
- void tearDown() {
- delete factoryCollection_;
- }
-
- void testParse_Available() {
- PresenceParser testling(factoryCollection_);
- StanzaParserTester parser(&testling);
-
- CPPUNIT_ASSERT(parser.parse("<presence/>"));
-
- CPPUNIT_ASSERT_EQUAL(Presence::Available, testling.getStanzaGeneric()->getType());
- }
-
- void testParse_Unavailable() {
- PresenceParser testling(factoryCollection_);
- StanzaParserTester parser(&testling);
-
- CPPUNIT_ASSERT(parser.parse("<presence type=\"unavailable\"/>"));
-
- CPPUNIT_ASSERT_EQUAL(Presence::Unavailable, testling.getStanzaGeneric()->getType());
- }
-
- void testParse_Probe() {
- PresenceParser testling(factoryCollection_);
- StanzaParserTester parser(&testling);
-
- CPPUNIT_ASSERT(parser.parse("<presence type=\"probe\"/>"));
-
- CPPUNIT_ASSERT_EQUAL(Presence::Probe, testling.getStanzaGeneric()->getType());
- }
-
- void testParse_Subscribe() {
- PresenceParser testling(factoryCollection_);
- StanzaParserTester parser(&testling);
-
- CPPUNIT_ASSERT(parser.parse("<presence type=\"subscribe\"/>"));
-
- CPPUNIT_ASSERT_EQUAL(Presence::Subscribe, testling.getStanzaGeneric()->getType());
- }
-
- void testParse_Subscribed() {
- PresenceParser testling(factoryCollection_);
- StanzaParserTester parser(&testling);
-
- CPPUNIT_ASSERT(parser.parse("<presence type=\"subscribed\"/>"));
-
- CPPUNIT_ASSERT_EQUAL(Presence::Subscribed, testling.getStanzaGeneric()->getType());
- }
-
- void testParse_Unsubscribe() {
- PresenceParser testling(factoryCollection_);
- StanzaParserTester parser(&testling);
-
- CPPUNIT_ASSERT(parser.parse("<presence type=\"unsubscribe\"/>"));
-
- CPPUNIT_ASSERT_EQUAL(Presence::Unsubscribe, testling.getStanzaGeneric()->getType());
- }
-
- void testParse_Unsubscribed() {
- PresenceParser testling(factoryCollection_);
- StanzaParserTester parser(&testling);
-
- CPPUNIT_ASSERT(parser.parse("<presence type=\"unsubscribed\"/>"));
-
- CPPUNIT_ASSERT_EQUAL(Presence::Unsubscribed, testling.getStanzaGeneric()->getType());
- }
-
- void testParse_Error() {
- PresenceParser testling(factoryCollection_);
- StanzaParserTester parser(&testling);
-
- CPPUNIT_ASSERT(parser.parse("<presence type=\"error\"/>"));
-
- CPPUNIT_ASSERT_EQUAL(Presence::Error, testling.getStanzaGeneric()->getType());
- }
-
- private:
- PayloadParserFactoryCollection* factoryCollection_;
-};
-
-CPPUNIT_TEST_SUITE_REGISTRATION(PresenceParserTest);