partial-sync: add unsubscribe feature

Change-Id: Ib32aa2c0acebb5be40bb8d99689a3ea18113a692
diff --git a/tests/test-consumer.cpp b/tests/test-consumer.cpp
index 79ee495..62715bb 100644
--- a/tests/test-consumer.cpp
+++ b/tests/test-consumer.cpp
@@ -45,6 +45,23 @@
   BOOST_CHECK(!consumer.addSubscription(subscription, 0));
 }
 
+BOOST_AUTO_TEST_CASE(RemoveSubscription)
+{
+  util::DummyClientFace face;
+  Consumer consumer(Name("/psync"), face,
+                    [] (const auto&) {},
+                    [] (const auto&) {},
+                    40, 0.001);
+
+  Name subscription("test");
+  consumer.addSubscription(subscription, 0);
+
+  BOOST_CHECK(consumer.isSubscribed(subscription));
+  BOOST_CHECK(consumer.removeSubscription(subscription));
+  BOOST_CHECK(!consumer.removeSubscription(subscription));
+  BOOST_CHECK(!consumer.isSubscribed(subscription));
+}
+
 BOOST_FIXTURE_TEST_CASE(ConstantTimeoutForFirstSegment, tests::IoFixture)
 {
   util::DummyClientFace face(m_io);