diff --git a/tests/ping/server/ping-server.t.cpp b/tests/ping/server/ping-server.t.cpp
new file mode 100644
index 0000000..874f1b2
--- /dev/null
+++ b/tests/ping/server/ping-server.t.cpp
@@ -0,0 +1,96 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014-2015,  Arizona Board of Regents.
+ *
+ * This file is part of ndn-tools (Named Data Networking Essential Tools).
+ * See AUTHORS.md for complete list of ndn-tools authors and contributors.
+ *
+ * ndn-tools 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.
+ *
+ * ndn-tools 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
+ * ndn-tools, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "tools/ping/server/ping-server.hpp"
+#include <ndn-cxx/util/dummy-client-face.hpp>
+
+#include "tests/test-common.hpp"
+
+namespace ndn {
+namespace ping {
+namespace server {
+namespace tests {
+
+using namespace ndn::tests;
+
+BOOST_AUTO_TEST_SUITE(PingServerPingServer)
+
+class CreatePingServerFixture : public UnitTestTimeFixture
+{
+protected:
+  CreatePingServerFixture()
+    : face(util::makeDummyClientFace(io, {false, true}))
+    , pingOptions(makeOptions())
+    , pingServer(*face, pingOptions)
+  {
+  }
+
+  Interest
+  makePingInterest(int seq) const
+  {
+    Name name(pingOptions.prefix);
+    name.append("ping");
+    name.append(std::to_string(seq));
+    Interest interest(name);
+    interest.setMustBeFresh(true);
+    interest.setInterestLifetime(time::milliseconds(2000));
+    return interest;
+  }
+
+private:
+  static Options
+  makeOptions()
+  {
+    Options opt;
+    opt.prefix = "ndn:/test-prefix";
+    opt.freshnessPeriod = time::milliseconds(5000);
+    opt.nMaxPings = 2;
+    opt.shouldPrintTimestamp = false;
+    opt.payloadSize = 0;
+    return opt;
+  }
+
+protected:
+  boost::asio::io_service io;
+  shared_ptr<util::DummyClientFace> face;
+  Options pingOptions;
+  PingServer pingServer;
+};
+
+BOOST_FIXTURE_TEST_CASE(CreatePingServer, CreatePingServerFixture)
+{
+  BOOST_REQUIRE_EQUAL(0, pingServer.getNPings());
+  pingServer.start();
+
+  this->advanceClocks(io, time::milliseconds(1), 200);
+
+  face->receive(makePingInterest(1000));
+  face->receive(makePingInterest(1001));
+
+  io.run();
+
+  BOOST_REQUIRE_EQUAL(2, pingServer.getNPings());
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace server
+} // namespace ping
+} // namespace ndn
