diff --git a/docs/INSTALL.rst b/docs/INSTALL.rst
index 2f545a4..eaf4a88 100644
--- a/docs/INSTALL.rst
+++ b/docs/INSTALL.rst
@@ -9,6 +9,21 @@
 -  Install the `ndn-cxx library <http://named-data.net/doc/ndn-cxx/current/INSTALL.html>`_
    and its requirements
 
+Another additional libraries include:
+-  ``log4cxx``
+
+   On OS X 10.8, 10.9 and 10.10 with MacPorts:
+
+   ::
+
+       sudo port install log4cxx
+
+   On Ubuntu >= 12.04:
+
+   ::
+
+       sudo apt-get install liblog4cxx10-dev
+
 To build manpages and API documentation:
 
 -  ``doxygen``
diff --git a/src/clients/response.cpp b/src/clients/response.cpp
new file mode 100644
index 0000000..8aba4ba
--- /dev/null
+++ b/src/clients/response.cpp
@@ -0,0 +1,237 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014, Regents of the University of California.
+ *
+ * This file is part of NDNS (Named Data Networking Domain Name Service).
+ * See AUTHORS.md for complete list of NDNS authors and contributors.
+ *
+ * NDNS 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.
+ *
+ * NDNS 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
+ * NDNS, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "response.hpp"
+#include "logger.hpp"
+
+namespace ndn {
+namespace ndns {
+
+Response::Response()
+  : m_ndnsType(NDNS_RAW)
+  , m_freshnessPeriod(DEFAULT_RR_FRESHNESS_PERIOD)
+  , m_appContent(dataBlock(ndn::tlv::Content, reinterpret_cast<const uint8_t*>(0), 0))
+{
+}
+
+Response::Response(const Name& zone, const name::Component& queryType)
+  : m_zone(zone)
+  , m_queryType(queryType)
+  , m_ndnsType(NDNS_RAW)
+  , m_freshnessPeriod(DEFAULT_RR_FRESHNESS_PERIOD)
+  , m_appContent(dataBlock(ndn::tlv::Content, reinterpret_cast<const uint8_t*>(0), 0))
+{
+}
+
+template<bool T>
+inline size_t
+Response::wireEncode(EncodingImpl<T>& block) const
+{
+  if (m_ndnsType == NDNS_RAW) {
+    // Raw application content
+    return prependBlock(block, m_appContent);
+  }
+
+  // Content :: = CONTENT-TYPE TLV-LENGTH
+  //              Block*
+
+  size_t totalLength = 0;
+  for (std::vector<Block>::const_reverse_iterator iter = m_rrs.rbegin();
+       iter != m_rrs.rend(); ++iter) {
+    totalLength += prependBlock(block, *iter);
+  }
+
+  totalLength += block.prependVarNumber(totalLength);
+  totalLength += block.prependVarNumber(::ndn::tlv::Content);
+
+  return totalLength;
+}
+
+const Block
+Response::wireEncode() const
+{
+  if (m_ndnsType == NDNS_RAW) {
+    return m_appContent;
+  }
+
+  EncodingEstimator estimator;
+  size_t estimatedSize = wireEncode(estimator);
+  EncodingBuffer buffer(estimatedSize, 0);
+  wireEncode(buffer);
+  return buffer.block();
+}
+
+void
+Response::wireDecode(const Block& wire)
+{
+  if (m_ndnsType == NDNS_RAW) {
+    m_appContent = wire;
+    return;
+  }
+
+  wire.parse();
+
+  Block::element_const_iterator iter = wire.elements().begin();
+  for (; iter != wire.elements().end(); ++iter) {
+    m_rrs.push_back(*iter);
+  }
+}
+
+bool
+Response::fromData(const Name& hint, const Name& zone, const Data& data)
+{
+  label::MatchResult re;
+  if (!matchName(data, hint, zone, re))
+    return false;
+
+  m_rrLabel = re.rrLabel;
+  m_rrType = re.rrType;
+  m_version = re.version;
+
+  m_zone = zone;
+  size_t len = zone.size();
+  if (!hint.empty())
+    len += hint.size() + 1;
+  m_queryType = data.getName().get(len);
+
+  MetaInfo info = data.getMetaInfo();
+
+  m_freshnessPeriod = time::duration_cast<time::seconds>(info.getFreshnessPeriod());
+  const Block* block = info.findAppMetaInfo(tlv::NdnsType);
+  if (block != 0)
+    m_ndnsType = static_cast<NdnsType>(readNonNegativeInteger(*block));
+
+  wireDecode(data.getContent());
+  return true;
+}
+
+
+shared_ptr<Data>
+Response::toData()
+{
+  Name name;
+  name.append(m_zone)
+      .append(m_queryType)
+      .append(m_rrLabel)
+      .append(m_rrType);
+
+  if (m_version.empty()) {
+    name.appendVersion();
+    m_version = name.get(-1);
+  }
+  else {
+    name.append(m_version);
+  }
+
+  shared_ptr<Data> data = make_shared<Data>(name);
+
+  MetaInfo info;
+  info.setFreshnessPeriod(m_freshnessPeriod);
+
+  if (m_ndnsType != NDNS_RAW) {
+    info.addAppMetaInfo(nonNegativeIntegerBlock(ndns::tlv::NdnsType, m_ndnsType));
+    data->setContent(this->wireEncode());
+  }
+  else {
+    data->setContent(m_appContent);
+  }
+  data->setMetaInfo(info);
+
+  return data;
+}
+
+
+Response&
+Response::addRr(const Block& rr)
+{
+  this->m_rrs.push_back(rr);
+  return *this;
+}
+
+Response&
+Response::addRr(const std::string& rr)
+{
+  return this->addRr(dataBlock(ndns::tlv::RrData, rr.c_str(), rr.size()));
+}
+
+bool
+Response::removeRr(const Block& rr)
+{
+  for (std::vector<Block>::iterator iter = m_rrs.begin(); iter != m_rrs.end(); ++iter) {
+    if (*iter == rr) {
+      m_rrs.erase(iter);
+      return true;
+    }
+  }
+  return false;
+}
+
+void
+Response::setAppContent(const Block& block)
+{
+  if (block.type() != ndn::tlv::Content) {
+    m_appContent = Block(ndn::tlv::Content, block);
+  } else
+    m_appContent = block;
+
+  m_appContent.encode(); // this is a must
+}
+
+
+bool
+Response::operator==(const Response& other) const
+{
+  bool tmp = (getZone() == other.getZone() &&
+              getQueryType() == other.getQueryType() && getRrLabel() == other.getRrLabel() &&
+              getRrType() == other.getRrType() && getVersion() == other.getVersion() &&
+              getNdnsType() == other.getNdnsType());
+
+  if (tmp == false)
+    return tmp;
+
+  if (m_ndnsType == NDNS_RAW) {
+    return tmp && (getAppContent() == other.getAppContent());
+  }
+  else
+    return tmp && getRrs() == other.getRrs();
+}
+
+std::ostream&
+operator<<(std::ostream& os, const Response& response)
+{
+  os << "Response: zone=" << response.getZone()
+     << " queryType=" << response.getQueryType()
+     << " rrLabel=" << response.getRrLabel()
+     << " rrType=" << response.getRrType()
+     << " version=" << response.getVersion()
+     << " freshnessPeriod=" << response.getFreshnessPeriod()
+     << " ndnsType=" << response.getNdnsType();
+  if (response.getNdnsType() == NDNS_RAW) {
+    if (response.getAppContent().empty())
+      os << " appContent=NULL";
+    else
+      os << " appContentSize=" << response.getAppContent().size();
+  }
+  else {
+    os << " rrs.size=" << response.getRrs().size();
+  }
+  return os;
+}
+} // namespace ndns
+} // namespace ndn
diff --git a/src/clients/response.hpp b/src/clients/response.hpp
new file mode 100644
index 0000000..fc49846
--- /dev/null
+++ b/src/clients/response.hpp
@@ -0,0 +1,264 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014, Regents of the University of California.
+ *
+ * This file is part of NDNS (Named Data Networking Domain Name Service).
+ * See AUTHORS.md for complete list of NDNS authors and contributors.
+ *
+ * NDNS 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.
+ *
+ * NDNS 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
+ * NDNS, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef NDNS_CLIENTS_RESPONSE_HPP
+#define NDNS_CLIENTS_RESPONSE_HPP
+
+#include "ndns-tlv.hpp"
+#include "ndns-enum.hpp"
+#include "ndns-label.hpp"
+
+
+#include <ndn-cxx/face.hpp>
+#include <ndn-cxx/name.hpp>
+#include <ndn-cxx/data.hpp>
+#include <ndn-cxx/encoding/block-helpers.hpp>
+#include <ndn-cxx/encoding/block.hpp>
+#include <ndn-cxx/meta-info.hpp>
+
+#include <vector>
+
+namespace ndn {
+namespace ndns {
+
+/**
+ * @brief content when update succeeds
+ */
+const Block UPDATE_OK = dataBlock(ndn::tlv::Content, "Update OK", 9);
+
+/**
+ * @brief content when update fails because of the out-dated update message
+ */
+const Block UPDATE_FAIL_OLD_VERSION = dataBlock(ndn::tlv::Content,
+                                                "Update Fails. Error: old version update", 39);
+
+/**
+ * @brief string prefix to judge Update fails or not
+ */
+const std::string UPDATE_FAIL("Update Fails. Error: ");
+
+/**
+ *@brief Default life time of resource record
+ */
+const time::seconds DEFAULT_RR_FRESHNESS_PERIOD(3600);
+
+
+/**
+ * @brief NDNS Response abstraction. Response is used on client side,
+ * while Rrset is used on server side, and Data packet is used during transmission in network.
+ */
+class Response
+{
+public:
+  Response();
+
+  Response(const Name& zone, const name::Component& queryType);
+
+  /**
+   * @brief fill the attributes from Data packet.
+   * @param[in] data Data.getName() must the same hint (if has) and zone as its prefix,
+   * otherwise it's undefined behavior
+   * @return false if Data.getName() does not follow the structure of NDNS Response without
+   * changing any attributes, otherwise return true and fill the attributes
+   */
+  bool
+  fromData(const Name& hint, const Name& zone, const Data& data);
+
+  shared_ptr<Data>
+  toData();
+
+  Response&
+  addRr(const Block& rr);
+
+  /**
+   * @brief add Block which contains string information and its tlv type is ndns::tlv::RrData
+   * Response is service level information, the encoding level abstraction,
+   * i.e., Block is not very convenient.
+   */
+  Response&
+  addRr(const std::string& rr);
+
+  bool
+  removeRr(const Block& rr);
+
+  bool
+  operator==(const Response& other) const;
+
+  bool
+  operator!=(const Response& other) const
+  {
+    return !(*this == other);
+  }
+
+  /**
+   * @brief encode the app-level data
+   */
+  const Block
+  wireEncode() const;
+
+  /**
+   * @brief decode the app-level data
+   */
+  void
+  wireDecode(const Block& wire);
+
+  /**
+   * @brief encode app-level data
+   */
+  template<bool T>
+  size_t
+  wireEncode(EncodingImpl<T> & block) const;
+
+public:
+  ///////////////////////////////////////////////
+  // getter and setter
+
+  const Name&
+  getZone() const
+  {
+    return m_zone;
+  }
+
+  void
+  setZone(const Name& zone)
+  {
+    m_zone = zone;
+  }
+
+  const name::Component&
+  getQueryType() const
+  {
+    return m_queryType;
+  }
+
+  void
+  setQueryType(const name::Component& queryType)
+  {
+    m_queryType = queryType;
+  }
+
+  const Name&
+  getRrLabel() const
+  {
+    return m_rrLabel;
+  }
+
+  void
+  setRrLabel(const Name& rrLabel)
+  {
+    m_rrLabel = rrLabel;
+  }
+
+  void
+  setRrType(const name::Component& rrType)
+  {
+    m_rrType = rrType;
+  }
+
+  const name::Component&
+  getRrType() const
+  {
+    return m_rrType;
+  }
+
+  void
+  setVersion(const name::Component& version)
+  {
+    m_version = version;
+  }
+
+  const name::Component&
+  getVersion() const
+  {
+    return m_version;
+  }
+
+  void
+  setNdnsType(NdnsType ndnsType)
+  {
+    m_ndnsType = ndnsType;
+  }
+
+  const NdnsType
+  getNdnsType() const
+  {
+    return m_ndnsType;
+  }
+
+  const Block&
+  getAppContent() const
+  {
+    return m_appContent;
+  }
+
+  void
+  setAppContent(const Block& block);
+
+  const std::vector<Block>&
+  getRrs() const
+  {
+    return m_rrs;
+  }
+
+  void
+  setRrs(const std::vector<Block>& rrs)
+  {
+    m_rrs = rrs;
+  }
+
+  time::seconds
+  getFreshnessPeriod() const
+  {
+    return m_freshnessPeriod;
+  }
+
+  void
+  setFreshnessPeriod(time::seconds freshnessPeriod)
+  {
+    m_freshnessPeriod = freshnessPeriod;
+  }
+
+private:
+  Name m_zone;
+  name::Component m_queryType;
+  Name m_rrLabel;
+  name::Component m_rrType;
+  name::Component m_version;
+
+  NdnsType m_ndnsType;
+  time::seconds m_freshnessPeriod;
+
+  /**
+   * @brief App content. Be valid only for NDNS-NULL Response
+   */
+  Block m_appContent;
+
+  /**
+   * @brief Content of Resource Record. Be valid only when this is not a NDNS-NULL Response
+   */
+  std::vector<Block> m_rrs;
+};
+
+std::ostream&
+operator<<(std::ostream& os, const Response& response);
+
+} // namespace ndns
+} // namespace ndn
+
+#endif // NDNS_CLIENTS_RESPONSE_HPP
diff --git a/src/ndns-enum.cpp b/src/ndns-enum.cpp
index 2631e38..45504fb 100644
--- a/src/ndns-enum.cpp
+++ b/src/ndns-enum.cpp
@@ -22,21 +22,27 @@
 namespace ndn {
 namespace ndns {
 
-std::string
-toString(NdnsType ndnsType)
+std::ostream&
+operator<<(std::ostream& os, const NdnsType ndnsType)
 {
   switch (ndnsType) {
   case NDNS_RESP:
-    return "NDNS-Resp";
+    os << "NDNS-Resp";
+    break;
   case NDNS_NACK:
-    return "NDNS-Nack";
+    os << "NDNS-Nack";
+    break;
   case NDNS_AUTH:
-    return "NDNS-Auth";
+    os << "NDNS-Auth";
+    break;
   case NDNS_RAW:
-    return "NDNS-Raw";
+    os << "NDNS-Raw";
+    break;
   default:
-    return "UNKNOWN";
+    os << "UNKNOWN";
+    break;
   }
+  return os;
 }
 
 } // namespace ndns
diff --git a/src/ndns-enum.hpp b/src/ndns-enum.hpp
index 617be9c..be48bd1 100644
--- a/src/ndns-enum.hpp
+++ b/src/ndns-enum.hpp
@@ -20,7 +20,7 @@
 #ifndef NDNS_NDNS_ENUM_HPP
 #define NDNS_NDNS_ENUM_HPP
 
-#include <string>
+#include <ostream>
 
 namespace ndn {
 namespace ndns {
@@ -37,11 +37,8 @@
   NDNS_UNKNOWN = 255
 };
 
-/*
- * @brief convert the ResponseType to String
- */
-std::string
-toString(NdnsType ndnsType);
+std::ostream&
+operator<<(std::ostream& os, const NdnsType ndnsType);
 
 } // namespace ndns
 } // namespace ndn
diff --git a/src/ndns-label.cpp b/src/ndns-label.cpp
index 6d0d1ae..585509c 100644
--- a/src/ndns-label.cpp
+++ b/src/ndns-label.cpp
@@ -37,7 +37,7 @@
     BOOST_ASSERT(name.size() > skip);
 
     BOOST_ASSERT(name.getPrefix(hint.size()) == hint);
-    BOOST_ASSERT(name.get(hint.size()) == ForwardingHintLabel);
+    BOOST_ASSERT(name.get(hint.size()) == FORWARDING_HINT_LABEL);
     BOOST_ASSERT(name.getSubName(hint.size() + 1, zone.size()) == zone);
 
   }
@@ -47,8 +47,8 @@
     BOOST_ASSERT(name.getPrefix(zone.size()) == zone);
   }
 
-  BOOST_ASSERT(name.get(skip) == NdnsIterativeQuery ||
-               name.get(skip) == NdnsCertQuery);
+  BOOST_ASSERT(name.get(skip) == NDNS_ITERATIVE_QUERY ||
+               name.get(skip) == NDNS_CERT_QUERY);
 
   ++skip;
   return skip;
diff --git a/src/ndns-label.hpp b/src/ndns-label.hpp
index accab00..6641eca 100644
--- a/src/ndns-label.hpp
+++ b/src/ndns-label.hpp
@@ -31,21 +31,22 @@
 namespace ndns {
 namespace label {
 
+
 /**
  * @brief NDNS iterative query type
  */
 
-const name::Component NdnsIterativeQuery("NDNS");
+const name::Component NDNS_ITERATIVE_QUERY("NDNS");
 
 /**
  * @brief NDNS recursive query type
  */
-const name::Component NdnsRecursiveQuery("NDNS-R");
+const name::Component NDNS_RECURSIVE_QUERY("NDNS-R");
 
 /**
  * @brief NDNS ID-CERT query type
  */
-const name::Component NdnsCertQuery("KEY");
+const name::Component NDNS_CERT_QUERY("KEY");
 
 /////////////////////////////////////////////
 
@@ -53,24 +54,31 @@
  * @brief label of forwarding hint
  * @todo not support forwarding hint yet, for future use
  */
-const name::Component ForwardingHintLabel("\xF0.");
+const name::Component FORWARDING_HINT_LABEL("\xF0.");
 
 /**
  * @brief label of update message, located at the last component in Interest name
  */
-const name::Component NdnsUpdateLabel("UPDATE");
+const name::Component NDNS_UPDATE_LABEL("UPDATE");
+
 
 //////////////////////////////////////////////
 
 /**
  * @brief NS resource record type
  */
-const name::Component NsRrType("NS");
+const name::Component NS_RR_TYPE("NS");
 
 /**
  * @brief ID-CERT resource record type
  */
-const name::Component CertRrType("ID-CERT");
+const name::Component CERT_RR_TYPE("ID-CERT");
+
+/**
+ * @brief TXT resource record type
+ */
+const name::Component TXT_RR_TYPE("TXT");
+
 
 //////////////////////////////////////////
 
@@ -97,8 +105,8 @@
  */
 bool
 matchName(const Interest& interest,
-           const Name& hint, const Name& zone,
-           MatchResult& result);
+          const Name& hint, const Name& zone,
+          MatchResult& result);
 
 /**
  * @brief match the Data (NDNS query response, NDNS update response) name
@@ -116,6 +124,7 @@
           const Name& hint, const Name& zone,
           MatchResult& result);
 
+
 } // namespace label
 } // namespace ndns
 } // namespace ndn
diff --git a/src/ndns-tlv.hpp b/src/ndns-tlv.hpp
index 7c48920..3575ab0 100644
--- a/src/ndns-tlv.hpp
+++ b/src/ndns-tlv.hpp
@@ -31,8 +31,8 @@
  */
 enum {
   NdnsType = 180, ///< Detailed Types are defined in NdnsType in ndns-enum.hpp
-  RrType = 190,
-  RrDataType = 191
+  Rr = 190,
+  RrData = 191
 };
 
 } // namespace tlv
diff --git a/tests/unit/clients/response.cpp b/tests/unit/clients/response.cpp
new file mode 100644
index 0000000..b1a82be
--- /dev/null
+++ b/tests/unit/clients/response.cpp
@@ -0,0 +1,90 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014, Regents of the University of California.
+ *
+ * This file is part of NDNS (Named Data Networking Domain Name Service).
+ * See AUTHORS.md for complete list of NDNS authors and contributors.
+ *
+ * NDNS 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.
+ *
+ * NDNS 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
+ * NDNS, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "clients/response.hpp"
+#include <ndn-cxx/security/key-chain.hpp>
+#include "../../boost-test.hpp"
+
+namespace ndn {
+namespace ndns {
+namespace tests {
+
+
+
+BOOST_AUTO_TEST_SUITE(Response)
+
+BOOST_AUTO_TEST_CASE(Basic)
+{
+  KeyChain keyChain;
+  Name hint;
+  Name zone("/net");
+  name::Component qType = ndns::label::NDNS_ITERATIVE_QUERY;
+
+
+  ndns::Response r(zone, qType);
+  r.setRrLabel(Name("/ndnsim/www"));
+  r.setRrType(label::CERT_RR_TYPE);
+  r.setNdnsType(NDNS_RAW);
+  r.setFreshnessPeriod(time::seconds(4000));
+
+  BOOST_CHECK_EQUAL(r.getFreshnessPeriod(), time::seconds(4000));
+  BOOST_CHECK_EQUAL(r.getRrType(), label::CERT_RR_TYPE);
+  BOOST_CHECK_EQUAL(r.getNdnsType(), NDNS_RAW);
+  BOOST_CHECK_EQUAL(r.getZone(), zone);
+  BOOST_CHECK_EQUAL(r.getQueryType(), qType);
+
+  const std::string DATA1("some fake content");
+  r.setAppContent(dataBlock(ndn::tlv::Content, DATA1.c_str(), DATA1.size()));
+
+  //const Block& block = r.wireEncode();
+  shared_ptr<Data> data = r.toData();
+  // keyChain.sign(*data);
+
+  ndns::Response r2;
+  BOOST_CHECK_EQUAL(r2.fromData(hint, zone, *data), true);
+  BOOST_CHECK_EQUAL(r, r2);
+
+  ndns::Response r4(zone, qType);
+  r4.setRrLabel(Name("/ndnsim/www"));
+  r4.setRrType(label::TXT_RR_TYPE);
+  r4.setNdnsType(NDNS_RESP);
+
+  std::string str = "Just try it";
+  Block s = dataBlock(ndns::tlv::RrData, str.c_str(), str.size());
+  r4.addRr(s);
+  str = "Go to Hell";
+  // Block s2 = dataBlock(ndns::tlv::RrData, str.c_str(), str.size());
+  r4.addRr(str);
+
+  BOOST_CHECK_NE(r2, r4);
+
+  data = r4.toData();
+  // keyChain.sign(*data);
+
+  ndns::Response r5(zone, qType);
+
+  BOOST_CHECK_EQUAL(r5.fromData(hint, zone, *data), true);
+  BOOST_CHECK_EQUAL(r4, r5);
+ }
+
+BOOST_AUTO_TEST_SUITE_END()
+
+} // namespace tests
+} // namespace ndns
+} // namespace ndn
diff --git a/tests/unit/ndns-enum.cpp b/tests/unit/ndns-enum.cpp
deleted file mode 100644
index 7559448..0000000
--- a/tests/unit/ndns-enum.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014, Regents of the University of California.
- *
- * This file is part of NDNS (Named Data Networking Domain Name Service).
- * See AUTHORS.md for complete list of NDNS authors and contributors.
- *
- * NDNS 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.
- *
- * NDNS 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
- * NDNS, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "ndns-enum.hpp"
-#include "../boost-test.hpp"
-
-namespace ndn {
-namespace ndns {
-namespace tests {
-
-BOOST_AUTO_TEST_SUITE(NdnsEnum)
-
-BOOST_AUTO_TEST_CASE(NdnsTypeToString)
-{
-  BOOST_CHECK_EQUAL(toString(NDNS_RESP), "NDNS-Resp");
-  BOOST_CHECK_EQUAL(toString(NDNS_AUTH), "NDNS-Auth");
-  BOOST_CHECK_EQUAL(toString(NDNS_NACK), "NDNS-Nack");
-  BOOST_CHECK_EQUAL(toString(NDNS_RAW), "NDNS-Raw");
-
-  BOOST_CHECK_EQUAL(toString(static_cast<NdnsType>(254)), "UNKNOWN");
-  BOOST_CHECK_EQUAL(toString(static_cast<NdnsType>(255)), "UNKNOWN");
-  BOOST_CHECK_EQUAL(toString(static_cast<NdnsType>(256)), "UNKNOWN");
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace tests
-} // namespace ndns
-} // namespace ndn
