diff --git a/tests/unit-tests/object-db.t.cpp b/tests/unit-tests/object-db.t.cpp
new file mode 100644
index 0000000..2428df3
--- /dev/null
+++ b/tests/unit-tests/object-db.t.cpp
@@ -0,0 +1,98 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2017, Regents of the University of California.
+ *
+ * This file is part of ChronoShare, a decentralized file sharing application over NDN.
+ *
+ * ChronoShare 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.
+ *
+ * ChronoShare 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 copies of the GNU General Public License along with
+ * ChronoShare, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ChronoShare authors and contributors.
+ */
+
+#include "object-db.hpp"
+
+#include "test-common.hpp"
+
+namespace ndn {
+namespace chronoshare {
+namespace tests {
+
+namespace fs = boost::filesystem;
+
+class TestObjectDbFixture : public IdentityManagementTimeFixture
+{
+public:
+  TestObjectDbFixture()
+  {
+    tmpdir = fs::unique_path(UNIT_TEST_CONFIG_PATH) / "TestObjectDb";
+    if (exists(tmpdir)) {
+      remove_all(tmpdir);
+    }
+  }
+
+public:
+  fs::path tmpdir;
+};
+
+BOOST_FIXTURE_TEST_SUITE(TestObjectDb, TestObjectDbFixture)
+
+BOOST_AUTO_TEST_CASE(Basic)
+{
+  BOOST_CHECK_EQUAL(ObjectDb::doesExist(tmpdir, "/my-device", "abcdef"), false);
+
+  Data data("/hello/world");
+  data.setContent(Name("/some/content").wireEncode());
+  m_keyChain.sign(data);
+
+  // Saving object
+  {
+    ObjectDb object(tmpdir, "abcdef");
+    BOOST_CHECK_EQUAL(object.getLastUsed(), time::steady_clock::now());
+
+    BOOST_CHECK_EQUAL(ObjectDb::doesExist(tmpdir, "/my-device", "abcdef"), false);
+
+    advanceClocks(time::hours(1));
+    BOOST_CHECK_NE(object.getLastUsed(), time::steady_clock::now());
+
+    object.saveContentObject("/my-device", 0, data);
+  }
+
+  // Retrieving object
+  {
+    ObjectDb object(tmpdir, "abcdef");
+
+    BOOST_CHECK_EQUAL(ObjectDb::doesExist(tmpdir, "/my-device", "abcdef"), true);
+    BOOST_CHECK(exists(tmpdir / "objects" / "ab" / "cdef"));
+    BOOST_CHECK_EQUAL(object.getLastUsed(), time::steady_clock::now());
+
+    advanceClocks(time::hours(1));
+    BOOST_CHECK_NE(object.getLastUsed(), time::steady_clock::now());
+
+    BOOST_CHECK(object.fetchSegment("/my-device", 0) != nullptr);
+    auto retrievedData = object.fetchSegment("/my-device", 0);
+    BOOST_REQUIRE(retrievedData != nullptr);
+    BOOST_CHECK_EQUAL(*retrievedData, data);
+    BOOST_CHECK_EQUAL(object.getLastUsed(), time::steady_clock::now());
+
+    advanceClocks(time::hours(1));
+    BOOST_CHECK_NE(object.getLastUsed(), time::steady_clock::now());
+
+    BOOST_CHECK(object.fetchSegment("/my-device", 1) == nullptr);
+    BOOST_CHECK_EQUAL(object.getLastUsed(), time::steady_clock::now());
+  }
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace chronoshare
+} // namespace ndn
diff --git a/tests/unit-tests/object-manager.t.cpp b/tests/unit-tests/object-manager.t.cpp
index 7b721c1..dc801a7 100644
--- a/tests/unit-tests/object-manager.t.cpp
+++ b/tests/unit-tests/object-manager.t.cpp
@@ -18,55 +18,64 @@
  * See AUTHORS.md for complete list of ChronoShare authors and contributors.
  */
 
-#include "logging.hpp"
 #include "object-manager.hpp"
 
-#include <boost/filesystem.hpp>
-#include <boost/filesystem/fstream.hpp>
+#include "test-common.hpp"
 
-#include <boost/make_shared.hpp>
-#include <boost/test/unit_test.hpp>
-#include <iostream>
-#include <iterator>
-#include <unistd.h>
+#include <ndn-cxx/util/dummy-client-face.hpp>
+
+namespace ndn {
+namespace chronoshare {
+namespace tests {
+
+namespace fs = boost::filesystem;
 
 _LOG_INIT(Test.ObjectManager);
 
-using namespace Ndnx;
-using namespace std;
-using namespace boost;
-namespace fs = boost::filesystem;
-
-BOOST_AUTO_TEST_SUITE(TestObjectManager)
-
-BOOST_AUTO_TEST_CASE(ObjectManagerTest)
+class TestObjectManagerFixture : public IdentityManagementTimeFixture
 {
-  fs::path tmpdir = fs::unique_path(fs::temp_directory_path() / "%%%%-%%%%-%%%%-%%%%");
-  _LOG_DEBUG("tmpdir: " << tmpdir);
+public:
+  TestObjectManagerFixture()
+    : face(m_io, m_keyChain, {true, true})
+  {
+    tmpdir = fs::unique_path(UNIT_TEST_CONFIG_PATH) / "TestObjectManager";
+    if (exists(tmpdir)) {
+      remove_all(tmpdir);
+    }
+    manager = make_unique<ObjectManager>(face, m_keyChain, tmpdir, "test-chronoshare");
+  }
+
+public:
+  util::DummyClientFace face;
+  unique_ptr<ObjectManager> manager;
+  fs::path tmpdir;
+};
+
+BOOST_FIXTURE_TEST_SUITE(TestObjectManager, TestObjectManagerFixture)
+
+BOOST_AUTO_TEST_CASE(FromFileToFile)
+{
   Name deviceName("/device");
 
-  CcnxWrapperPtr ccnx = make_shared<CcnxWrapper>();
-  ObjectManager manager(ccnx, tmpdir, "test-chronoshare");
+  auto objects = manager->localFileToObjects(fs::path("tests") / "unit-tests" / "object-manager.t.cpp", deviceName);
 
-  tuple<HashPtr, int> hash_semgents =
-    manager.localFileToObjects(fs::path("test") / "test-object-manager.cc", deviceName);
+  BOOST_CHECK_EQUAL(std::get<1>(objects), 3);
 
-  BOOST_CHECK_EQUAL(hash_semgents.get<1>(), 3);
-
-  bool ok = manager.objectsToLocalFile(deviceName, *hash_semgents.get<0>(), tmpdir / "test.cc");
+  bool ok = manager->objectsToLocalFile(deviceName, *std::get<0>(objects), tmpdir / "test.cpp");
   BOOST_CHECK_EQUAL(ok, true);
 
   {
-    fs::ifstream origFile(fs::path("test") / "test-object-manager.cc");
-    fs::ifstream newFile(tmpdir / "test.cc");
+    fs::ifstream origFile(fs::path("tests") / "unit-tests" / "object-manager.t.cpp");
+    fs::ifstream newFile(tmpdir / "test.cpp");
 
-    istream_iterator<char> eof, origFileI(origFile), newFileI(newFile);
+    std::istream_iterator<char> eof, origFileI(origFile), newFileI(newFile);
 
     BOOST_CHECK_EQUAL_COLLECTIONS(origFileI, eof, newFileI, eof);
   }
-
-  remove_all(tmpdir);
 }
 
-
 BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace chronoshare
+} // namespace ndn
diff --git a/tests/wscript b/tests/wscript
index ab3e5fe..06830fa 100644
--- a/tests/wscript
+++ b/tests/wscript
@@ -25,6 +25,7 @@
                                       'unit-tests/dummy-forwarder.cpp',
                                       'unit-tests/sync-*.t.cpp',
                                       'unit-tests/action-log.t.cpp',
+                                      'unit-tests/object-*.t.cpp',
                                       ],
                                      excl=['main.cpp']),
             use='chronoshare core-objects unit-tests-main',
