summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Queries/UnitTest/ResponderTest.cpp')
-rw-r--r--Swiften/Queries/UnitTest/ResponderTest.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/Swiften/Queries/UnitTest/ResponderTest.cpp b/Swiften/Queries/UnitTest/ResponderTest.cpp
index 513c6ac..9824c98 100644
--- a/Swiften/Queries/UnitTest/ResponderTest.cpp
+++ b/Swiften/Queries/UnitTest/ResponderTest.cpp
@@ -20,6 +20,8 @@ class ResponderTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(ResponderTest);
CPPUNIT_TEST(testConstructor);
+ CPPUNIT_TEST(testStart);
+ CPPUNIT_TEST(testStop);
CPPUNIT_TEST(testHandleIQ_Set);
CPPUNIT_TEST(testHandleIQ_Get);
CPPUNIT_TEST(testHandleIQ_Error);
@@ -46,9 +48,28 @@ class ResponderTest : public CppUnit::TestFixture
channel_->onIQReceived(createRequest(IQ::Set));
+ CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(testling.setPayloads_.size()));
+ }
+
+ void testStart() {
+ MyResponder testling(router_);
+
+ testling.start();
+ channel_->onIQReceived(createRequest(IQ::Set));
+
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(testling.setPayloads_.size()));
}
+ void testStop() {
+ MyResponder testling(router_);
+
+ testling.start();
+ testling.stop();
+ channel_->onIQReceived(createRequest(IQ::Set));
+
+ CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(testling.setPayloads_.size()));
+ }
+
void testHandleIQ_Set() {
MyResponder testling(router_);