diff --git a/tests/daemon/face/internal-client-face.t.cpp b/tests/daemon/face/internal-client-face.t.cpp
new file mode 100644
index 0000000..0b2295c
--- /dev/null
+++ b/tests/daemon/face/internal-client-face.t.cpp
@@ -0,0 +1,134 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014-2015,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "face/internal-client-face.hpp"
+#include "face/internal-face.hpp"
+#include "tests/test-common.hpp"
+#include "tests/identity-management-fixture.hpp"
+
+namespace nfd {
+namespace tests {
+
+class InternalClientFaceFixture : public UnitTestTimeFixture
+                                , public IdentityManagementFixture
+{
+public:
+  InternalClientFaceFixture()
+    : m_internalFace(make_shared<InternalFace>())
+    , m_face(makeInternalClientFace(m_internalFace, m_keyChain))
+  {
+  }
+
+protected:
+  shared_ptr<InternalFace> m_internalFace;
+  shared_ptr<InternalClientFace> m_face;
+};
+
+BOOST_FIXTURE_TEST_SUITE(FaceInternalClientFace, InternalClientFaceFixture)
+
+BOOST_AUTO_TEST_CASE(ExpressInterest)
+{
+  bool didReceiveDataBack = false;
+  bool didTimeoutCallbackFire = false;
+  Data receivedData;
+
+  auto expressInterest = [&] (shared_ptr<Interest> interest) {
+    didReceiveDataBack = false;
+    didTimeoutCallbackFire = false;
+    m_face->expressInterest(interest->setInterestLifetime(time::milliseconds(100)),
+                            [&] (const Interest& interest, Data& data) {
+                              didReceiveDataBack = true;
+                              receivedData = data;
+                            },
+                            bind([&] { didTimeoutCallbackFire = true; }));
+    advanceClocks(time::milliseconds(1));
+  };
+
+  expressInterest(makeInterest("/test/timeout"));
+  advanceClocks(time::milliseconds(1), 200); // wait for time out
+  BOOST_CHECK(didTimeoutCallbackFire);
+
+  auto dataToSend = makeData("/test/data")->setContent(Block("\x81\x01\0x01", 3));
+  expressInterest(makeInterest("/test/data"));
+  m_internalFace->sendData(dataToSend); // send data to satisfy the expressed interest
+  advanceClocks(time::milliseconds(1));
+  BOOST_CHECK(didReceiveDataBack);
+  BOOST_CHECK(receivedData.wireEncode() == dataToSend.wireEncode());
+}
+
+BOOST_AUTO_TEST_CASE(InterestFilter)
+{
+  bool didOnInterestCallbackFire = false;
+  Block receivedBlock, expectedBlock;
+
+  auto testSendInterest = [&] (shared_ptr<Interest> interest) {
+    didOnInterestCallbackFire = false;
+    expectedBlock = interest->wireEncode();
+    m_internalFace->sendInterest(*interest);
+  };
+
+  testSendInterest(makeInterest("/test/filter")); // no filter is set now
+  BOOST_CHECK(!didOnInterestCallbackFire);
+
+  // set filter
+  auto filter = m_face->setInterestFilter("/test/filter",
+                                          bind([&](const Interest& interset) {
+                                              didOnInterestCallbackFire = true;
+                                              receivedBlock = interset.wireEncode();
+                                            }, _2));
+  advanceClocks(time::milliseconds(1));
+
+  testSendInterest(makeInterest("/test/filter"));
+  BOOST_CHECK(didOnInterestCallbackFire);
+  BOOST_CHECK(receivedBlock == expectedBlock);
+
+  // unset filter
+  didOnInterestCallbackFire = false;
+  m_face->unsetInterestFilter(filter);
+  advanceClocks(time::milliseconds(1));
+  testSendInterest(makeInterest("/test/filter"));
+  BOOST_CHECK(!didOnInterestCallbackFire);
+}
+
+BOOST_AUTO_TEST_CASE(PutData)
+{
+  bool didInternalFaceReceiveData = false;
+  Data receivedData;
+  m_internalFace->onReceiveData.connect([&] (const Data& data) {
+      didInternalFaceReceiveData = true;
+      receivedData = data;
+    });
+
+  auto dataToPut = makeData("/test/put/data");
+  m_face->put(*dataToPut);
+  advanceClocks(time::milliseconds(1));
+  BOOST_CHECK(didInternalFaceReceiveData);
+  BOOST_CHECK(receivedData.wireEncode() == dataToPut->wireEncode());
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/face/internal-face.t.cpp b/tests/daemon/face/internal-face.t.cpp
new file mode 100644
index 0000000..44f5e7b
--- /dev/null
+++ b/tests/daemon/face/internal-face.t.cpp
@@ -0,0 +1,143 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014-2015,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "face/internal-face.hpp"
+#include "tests/test-common.hpp"
+
+namespace nfd {
+namespace tests {
+
+class InternalFaceFixture : protected BaseFixture
+{
+public:
+  InternalFaceFixture()
+  {
+    m_face.onReceiveInterest.connect([this] (const Interest& interest) {
+        inInterests.push_back(interest);
+      });
+    m_face.onSendInterest.connect([this] (const Interest& interest) {
+        outInterests.push_back(interest);
+      });
+    m_face.onReceiveData.connect([this] (const Data& data) {
+        inData.push_back(data);
+      });
+    m_face.onSendData.connect([this] (const Data& data) {
+        outData.push_back(data);
+      });
+  }
+
+protected:
+  InternalFace m_face;
+  std::vector<Interest> inInterests;
+  std::vector<Interest> outInterests;
+  std::vector<Data> inData;
+  std::vector<Data> outData;
+};
+
+BOOST_FIXTURE_TEST_SUITE(FaceInternalFace, InternalFaceFixture)
+
+BOOST_AUTO_TEST_CASE(SendInterest)
+{
+  BOOST_CHECK(outInterests.empty());
+
+  auto interest = makeInterest("/test/send/interest");
+  Block expectedBlock = interest->wireEncode(); // assign a value to nonce
+  m_face.sendInterest(*interest);
+
+  BOOST_CHECK_EQUAL(outInterests.size(), 1);
+  BOOST_CHECK(outInterests[0].wireEncode() == expectedBlock);
+}
+
+BOOST_AUTO_TEST_CASE(SendData)
+{
+  BOOST_CHECK(outData.empty());
+
+  auto data = makeData("/test/send/data");
+  m_face.sendData(*data);
+
+  BOOST_CHECK_EQUAL(outData.size(), 1);
+  BOOST_CHECK(outData[0].wireEncode() == data->wireEncode());
+}
+
+BOOST_AUTO_TEST_CASE(ReceiveInterest)
+{
+  BOOST_CHECK(inInterests.empty());
+
+  auto interest = makeInterest("/test/receive/interest");
+  Block expectedBlock = interest->wireEncode(); // assign a value to nonce
+  m_face.receiveInterest(*interest);
+
+  BOOST_CHECK_EQUAL(inInterests.size(), 1);
+  BOOST_CHECK(inInterests[0].wireEncode() == expectedBlock);
+}
+
+BOOST_AUTO_TEST_CASE(ReceiveData)
+{
+  BOOST_CHECK(inData.empty());
+
+  auto data = makeData("/test/send/data");
+  m_face.receiveData(*data);
+
+  BOOST_CHECK_EQUAL(inData.size(), 1);
+  BOOST_CHECK(inData[0].wireEncode() == data->wireEncode());
+}
+
+BOOST_AUTO_TEST_CASE(ReceiveBlock)
+{
+  BOOST_CHECK(inInterests.empty());
+  BOOST_CHECK(inData.empty());
+
+  Block interestBlock = makeInterest("test/receive/interest")->wireEncode();
+  m_face.receive(interestBlock);
+  BOOST_CHECK_EQUAL(inInterests.size(), 1);
+  BOOST_CHECK(inInterests[0].wireEncode() == interestBlock);
+
+  Block dataBlock = makeData("test/receive/data")->wireEncode();
+  m_face.receive(dataBlock);
+  BOOST_CHECK_EQUAL(inData.size(), 1);
+  BOOST_CHECK(inData[0].wireEncode() == dataBlock);
+}
+
+BOOST_AUTO_TEST_CASE(ExtractPacketFromBlock)
+{
+  {
+    Block block = makeInterest("/test/interest")->wireEncode();
+    const Block& payload = ndn::nfd::LocalControlHeader::getPayload(block);
+    auto interest = m_face.extractPacketFromBlock<Interest>(block, payload);
+    BOOST_CHECK(interest->wireEncode() == block);
+  }
+
+  {
+    Block block = makeData("/test/data")->wireEncode();
+    const Block& payload = ndn::nfd::LocalControlHeader::getPayload(block);
+    auto data = m_face.extractPacketFromBlock<Data>(block, payload);
+    BOOST_CHECK(data->wireEncode() == block);
+  }
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/mgmt/internal-face.t.cpp b/tests/daemon/mgmt/internal-face.t.cpp
deleted file mode 100644
index 29b602c..0000000
--- a/tests/daemon/mgmt/internal-face.t.cpp
+++ /dev/null
@@ -1,238 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "mgmt/internal-face.hpp"
-#include "tests/daemon/face/dummy-face.hpp"
-
-#include "tests/test-common.hpp"
-
-namespace nfd {
-namespace tests {
-
-class InternalFaceFixture : protected BaseFixture
-{
-public:
-
-  InternalFaceFixture()
-    : m_onInterestFired(false),
-      m_noOnInterestFired(false)
-  {
-
-  }
-
-  void
-  validateOnInterestCallback(const Name& name, const Interest& interest)
-  {
-    m_onInterestFired = true;
-  }
-
-  void
-  validateNoOnInterestCallback(const Name& name, const Interest& interest)
-  {
-    m_noOnInterestFired = true;
-  }
-
-  void
-  addFace(shared_ptr<Face> face)
-  {
-    m_faces.push_back(face);
-  }
-
-  bool
-  didOnInterestFire()
-  {
-    return m_onInterestFired;
-  }
-
-  bool
-  didNoOnInterestFire()
-  {
-    return m_noOnInterestFired;
-  }
-
-  void
-  resetOnInterestFired()
-  {
-    m_onInterestFired = false;
-  }
-
-  void
-  resetNoOnInterestFired()
-  {
-    m_noOnInterestFired = false;
-  }
-
-protected:
-  ndn::KeyChain m_keyChain;
-
-private:
-  std::vector<shared_ptr<Face> > m_faces;
-  bool m_onInterestFired;
-  bool m_noOnInterestFired;
-};
-
-BOOST_FIXTURE_TEST_SUITE(MgmtInternalFace, InternalFaceFixture)
-
-void
-validatePutData(bool& called, const Name& expectedName, const Data& data)
-{
-  called = true;
-  BOOST_CHECK_EQUAL(expectedName, data.getName());
-}
-
-BOOST_AUTO_TEST_CASE(PutData)
-{
-  addFace(make_shared<DummyFace>());
-
-  shared_ptr<InternalFace> face(new InternalFace);
-
-  bool didPutData = false;
-  Name dataName("/hello");
-  face->onReceiveData.connect(bind(&validatePutData, ref(didPutData), dataName, _1));
-
-  Data testData(dataName);
-  m_keyChain.sign(testData);
-  face->put(testData);
-
-  BOOST_REQUIRE(didPutData);
-
-  BOOST_CHECK_THROW(face->close(), InternalFace::Error);
-}
-
-BOOST_AUTO_TEST_CASE(SendInterestHitEnd)
-{
-  addFace(make_shared<DummyFace>());
-
-  shared_ptr<InternalFace> face(new InternalFace);
-
-  face->setInterestFilter("/localhost/nfd/fib",
-                          bind(&InternalFaceFixture::validateOnInterestCallback,
-                               this, _1, _2));
-
-  // generate command whose name is canonically
-  // ordered after /localhost/nfd/fib so that
-  // we hit the end of the std::map
-
-  Name commandName("/localhost/nfd/fib/end");
-  shared_ptr<Interest> command = makeInterest(commandName);
-  face->sendInterest(*command);
-  g_io.run_one();
-
-  BOOST_REQUIRE(didOnInterestFire());
-  BOOST_REQUIRE(didNoOnInterestFire() == false);
-}
-
-BOOST_AUTO_TEST_CASE(SendInterestHitBegin)
-{
-  addFace(make_shared<DummyFace>());
-
-  shared_ptr<InternalFace> face(new InternalFace);
-
-  face->setInterestFilter("/localhost/nfd/fib",
-                          bind(&InternalFaceFixture::validateNoOnInterestCallback,
-                               this, _1, _2));
-
-  // generate command whose name is canonically
-  // ordered before /localhost/nfd/fib so that
-  // we hit the beginning of the std::map
-
-  Name commandName("/localhost/nfd");
-  shared_ptr<Interest> command = makeInterest(commandName);
-  face->sendInterest(*command);
-  g_io.run_one();
-
-  BOOST_REQUIRE(didNoOnInterestFire() == false);
-}
-
-BOOST_AUTO_TEST_CASE(SendInterestHitExact)
-{
-  addFace(make_shared<DummyFace>());
-
-  shared_ptr<InternalFace> face(new InternalFace);
-
-  face->setInterestFilter("/localhost/nfd/eib",
-                          bind(&InternalFaceFixture::validateNoOnInterestCallback,
-                               this, _1, _2));
-
-  face->setInterestFilter("/localhost/nfd/fib",
-                          bind(&InternalFaceFixture::validateOnInterestCallback,
-                           this, _1, _2));
-
-  face->setInterestFilter("/localhost/nfd/gib",
-                          bind(&InternalFaceFixture::validateNoOnInterestCallback,
-                               this, _1, _2));
-
-  // generate command whose name exactly matches
-  // /localhost/nfd/fib
-
-  Name commandName("/localhost/nfd/fib");
-  shared_ptr<Interest> command = makeInterest(commandName);
-  face->sendInterest(*command);
-  g_io.run_one();
-
-  BOOST_REQUIRE(didOnInterestFire());
-  BOOST_REQUIRE(didNoOnInterestFire() == false);
-}
-
-BOOST_AUTO_TEST_CASE(SendInterestHitPrevious)
-{
-  addFace(make_shared<DummyFace>());
-
-  shared_ptr<InternalFace> face(new InternalFace);
-
-  face->setInterestFilter("/localhost/nfd/fib",
-                          bind(&InternalFaceFixture::validateOnInterestCallback,
-                               this, _1, _2));
-
-  face->setInterestFilter("/localhost/nfd/fib/zzzzzzzzzzzzz/",
-                          bind(&InternalFaceFixture::validateNoOnInterestCallback,
-                               this, _1, _2));
-
-  // generate command whose name exactly matches
-  // an Interest filter
-
-  Name commandName("/localhost/nfd/fib/previous");
-  shared_ptr<Interest> command = makeInterest(commandName);
-  face->sendInterest(*command);
-  g_io.run_one();
-
-  BOOST_REQUIRE(didOnInterestFire());
-  BOOST_REQUIRE(didNoOnInterestFire() == false);
-}
-
-BOOST_AUTO_TEST_CASE(InterestGone)
-{
-  shared_ptr<InternalFace> face = make_shared<InternalFace>();
-  shared_ptr<Interest> interest = makeInterest("ndn:/localhost/nfd/gone");
-  face->sendInterest(*interest);
-
-  interest.reset();
-  BOOST_CHECK_NO_THROW(g_io.poll());
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace nfd
