diff --git a/tests/unit-tests/interest.t.cpp b/tests/unit-tests/interest.t.cpp
index 295af50..6b2f2cf 100644
--- a/tests/unit-tests/interest.t.cpp
+++ b/tests/unit-tests/interest.t.cpp
@@ -544,57 +544,6 @@
   BOOST_CHECK(!i.hasSelectedDelegation());
 }
 
-BOOST_AUTO_TEST_CASE(EncodeChildSelector)
-{
-  Interest i;
-  i.setName("/local/ndn/prefix");
-  i.setNonce(1);
-  BOOST_CHECK_EQUAL(i.getChildSelector(), 0);
-  BOOST_CHECK_THROW(i.setChildSelector(-1), std::invalid_argument);
-  BOOST_CHECK_THROW(i.setChildSelector(2), std::invalid_argument);
-  BOOST_CHECK_NO_THROW(i.setChildSelector(1));
-  BOOST_CHECK_EQUAL(i.getChildSelector(), 1);
-  BOOST_CHECK_NO_THROW(i.setChildSelector(0));
-  BOOST_CHECK_EQUAL(i.getChildSelector(), 0);
-
-  const uint8_t expectedDefault[] = {
-    0x05, 0x1e, // MetaInfo
-          0x07, 0x14, // Name
-                0x08, 0x5, // NameComponent
-                      0x6c, 0x6f, 0x63, 0x61, 0x6c,
-                0x08, 0x3, // NameComponent
-                      0x6e, 0x64, 0x6e,
-                0x08, 0x6, // NameComponent
-                      0x70, 0x72, 0x65, 0x66, 0x69, 0x78,
-          0x09, 0x00, // Selectors
-          0x0a, 0x04, // Nonce
-                0x01, 0x00, 0x00, 0x00, // 1
-  };
-
-  BOOST_CHECK_EQUAL_COLLECTIONS(i.wireEncode().begin(), i.wireEncode().end(),
-                                expectedDefault, expectedDefault + sizeof(expectedDefault));
-
-  const uint8_t expected1[] = {
-    0x05, 0x21, // MetaInfo
-          0x07, 0x14, // Name
-                0x08, 0x5, // NameComponent
-                      0x6c, 0x6f, 0x63, 0x61, 0x6c,
-                0x08, 0x3, // NameComponent
-                      0x6e, 0x64, 0x6e,
-                0x08, 0x6, // NameComponent
-                      0x70, 0x72, 0x65, 0x66, 0x69, 0x78,
-          0x09, 0x03, // Selectors
-                0x11, 0x01, // ChildSelector
-                      0x01, // 1
-          0x0a, 0x04, // Nonce
-                0x01, 0x00, 0x00, 0x00, // 1
-  };
-
-  i.setChildSelector(1);
-  BOOST_CHECK_EQUAL_COLLECTIONS(i.wireEncode().begin(), i.wireEncode().end(),
-                                expected1, expected1 + sizeof(expected1));
-}
-
 BOOST_AUTO_TEST_CASE(EncodeInterestLifetime)
 {
   Interest i;
@@ -608,7 +557,7 @@
   BOOST_CHECK_NO_THROW(i.setInterestLifetime(DEFAULT_INTEREST_LIFETIME));
 
   const uint8_t expectedDefault[] = {
-    0x05, 0x1e, // MetaInfo
+    0x05, 0x1c, // Interest
           0x07, 0x14, // Name
                 0x08, 0x5, // NameComponent
                       0x6c, 0x6f, 0x63, 0x61, 0x6c,
@@ -616,7 +565,6 @@
                       0x6e, 0x64, 0x6e,
                 0x08, 0x6, // NameComponent
                       0x70, 0x72, 0x65, 0x66, 0x69, 0x78,
-          0x09, 0x00, // Selectors
           0x0a, 0x04, // Nonce
                 0x01, 0x00, 0x00, 0x00, // 1
   };
@@ -625,7 +573,7 @@
                                 expectedDefault, expectedDefault + sizeof(expectedDefault));
 
   const uint8_t expected1000ms[] = {
-    0x05, 0x22, // MetaInfo
+    0x05, 0x20, // Interest
           0x07, 0x14, // Name
                 0x08, 0x5, // NameComponent
                       0x6c, 0x6f, 0x63, 0x61, 0x6c,
@@ -633,7 +581,6 @@
                       0x6e, 0x64, 0x6e,
                 0x08, 0x6, // NameComponent
                       0x70, 0x72, 0x65, 0x66, 0x69, 0x78,
-          0x09, 0x00, // Selectors
           0x0a, 0x04, // Nonce
                 0x01, 0x00, 0x00, 0x00, // 1
           0x0c, 0x02, // InterestLifetime
@@ -726,80 +673,6 @@
   BOOST_CHECK_EQUAL(a != b, false);
 }
 
-BOOST_AUTO_TEST_CASE(SelectorsEqualityChecks)
-{
-  // Selectors ::= SELECTORS-TYPE TLV-LENGTH
-  //                 MinSuffixComponents?
-  //                 MaxSuffixComponents?
-  //                 PublisherPublicKeyLocator?
-  //                 Exclude?
-  //                 ChildSelector?
-  //                 MustBeFresh?
-
-  Selectors a;
-  Selectors b;
-  BOOST_CHECK_EQUAL(a == b, true);
-  BOOST_CHECK_EQUAL(a != b, false);
-
-  // MinSuffixComponents
-  a.setMinSuffixComponents(1);
-  BOOST_CHECK_EQUAL(a == b, false);
-  BOOST_CHECK_EQUAL(a != b, true);
-
-  b.setMinSuffixComponents(2);
-  BOOST_CHECK_EQUAL(a == b, false);
-  BOOST_CHECK_EQUAL(a != b, true);
-
-  b.setMinSuffixComponents(1);
-  BOOST_CHECK_EQUAL(a == b, true);
-  BOOST_CHECK_EQUAL(a != b, false);
-
-  // MaxSuffixComponents
-  a.setMaxSuffixComponents(10);
-  BOOST_CHECK_EQUAL(a == b, false);
-  BOOST_CHECK_EQUAL(a != b, true);
-
-  b.setMaxSuffixComponents(10);
-  BOOST_CHECK_EQUAL(a == b, true);
-  BOOST_CHECK_EQUAL(a != b, false);
-
-  // PublisherPublicKeyLocator
-  a.setPublisherPublicKeyLocator(KeyLocator("/key/Locator/name"));
-  BOOST_CHECK_EQUAL(a == b, false);
-  BOOST_CHECK_EQUAL(a != b, true);
-
-  b.setPublisherPublicKeyLocator(KeyLocator("/key/Locator/name"));
-  BOOST_CHECK_EQUAL(a == b, true);
-  BOOST_CHECK_EQUAL(a != b, false);
-
-  // Exclude
-  a.setExclude(Exclude().excludeOne(name::Component("exclude")));
-  BOOST_CHECK_EQUAL(a == b, false);
-  BOOST_CHECK_EQUAL(a != b, true);
-
-  b.setExclude(Exclude().excludeOne(name::Component("exclude")));
-  BOOST_CHECK_EQUAL(a == b, true);
-  BOOST_CHECK_EQUAL(a != b, false);
-
-  // ChildSelector
-  a.setChildSelector(1);
-  BOOST_CHECK_EQUAL(a == b, false);
-  BOOST_CHECK_EQUAL(a != b, true);
-
-  b.setChildSelector(1);
-  BOOST_CHECK_EQUAL(a == b, true);
-  BOOST_CHECK_EQUAL(a != b, false);
-
-  // MustBeFresh
-  a.setMustBeFresh(true);
-  BOOST_CHECK_EQUAL(a == b, false);
-  BOOST_CHECK_EQUAL(a != b, true);
-
-  b.setMustBeFresh(true);
-  BOOST_CHECK_EQUAL(a == b, true);
-  BOOST_CHECK_EQUAL(a != b, false);
-}
-
 BOOST_AUTO_TEST_CASE(LinkObject)
 {
   Link link1("test", {{100, "/test3"}, {20, "/test2"}, {10, "/test1"}});
diff --git a/tests/unit-tests/selectors.t.cpp b/tests/unit-tests/selectors.t.cpp
new file mode 100644
index 0000000..0b5d70f
--- /dev/null
+++ b/tests/unit-tests/selectors.t.cpp
@@ -0,0 +1,199 @@
+/* -*- 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 ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#include "selectors.hpp"
+
+#include "boost-test.hpp"
+
+namespace ndn {
+namespace tests {
+
+BOOST_AUTO_TEST_SUITE(TestSelectors)
+
+BOOST_AUTO_TEST_CASE(DefaultConstructor)
+{
+  Selectors s;
+  BOOST_CHECK(s.empty());
+  BOOST_CHECK_EQUAL(s.getMinSuffixComponents(), -1);
+  BOOST_CHECK_EQUAL(s.getMaxSuffixComponents(), -1);
+  BOOST_CHECK(s.getPublisherPublicKeyLocator().empty());
+  BOOST_CHECK(s.getExclude().empty());
+  BOOST_CHECK_EQUAL(s.getChildSelector(), 0);
+  BOOST_CHECK_EQUAL(s.getMustBeFresh(), false);
+}
+
+BOOST_AUTO_TEST_CASE(EncodeDecodeEmpty)
+{
+  const uint8_t WIRE[] = {
+    0x09, 0x00 // Selectors
+  };
+
+  Selectors s1;
+  Block wire1 = s1.wireEncode();
+  BOOST_CHECK_EQUAL_COLLECTIONS(wire1.begin(), wire1.end(), WIRE, WIRE + sizeof(WIRE));
+
+  Selectors s2(wire1);
+  BOOST_CHECK(s2.empty());
+  BOOST_CHECK_EQUAL(s2.getMinSuffixComponents(), -1);
+  BOOST_CHECK_EQUAL(s2.getMaxSuffixComponents(), -1);
+  BOOST_CHECK(s2.getPublisherPublicKeyLocator().empty());
+  BOOST_CHECK(s2.getExclude().empty());
+  BOOST_CHECK_EQUAL(s2.getChildSelector(), 0);
+  BOOST_CHECK_EQUAL(s2.getMustBeFresh(), false);
+
+  BOOST_CHECK(s1 == s2);
+}
+
+BOOST_AUTO_TEST_CASE(EncodeDecodeFull)
+{
+  const uint8_t WIRE[] = {
+    0x09, 0x39, // Selectors
+          0x0d, 0x01, 0x02, // MinSuffixComponents
+          0x0e, 0x01, 0x06,  // MaxSuffixComponent
+          0x1c, 0x16, // KeyLocator
+                0x07, 0x14, // Name
+                      0x08, 0x04, 0x74, 0x65, 0x73, 0x74,
+                      0x08, 0x03, 0x6b, 0x65, 0x79,
+                      0x08, 0x07, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72,
+          0x10, 0x14, // Exclude
+                0x08, 0x04, 0x61, 0x6c, 0x65, 0x78, // NameComponent
+                0x08, 0x04, 0x78, 0x78, 0x78, 0x78, // NameComponent
+                0x13, 0x00, // Any
+                0x08, 0x04, 0x79, 0x79, 0x79, 0x79, // NameComponent
+          0x11, 0x01, 0x01, // ChildSelector
+          0x12, 0x00 // MustBeFresh
+  };
+
+  Selectors s1;
+  s1.setMinSuffixComponents(2);
+  s1.setMaxSuffixComponents(6);
+  s1.setPublisherPublicKeyLocator(KeyLocator("/test/key/locator"));
+  s1.setExclude(Exclude().excludeOne(name::Component("alex"))
+                .excludeRange(name::Component("xxxx"), name::Component("yyyy")));
+  s1.setChildSelector(1);
+  s1.setMustBeFresh(true);
+
+  Block wire1 = s1.wireEncode();
+  BOOST_CHECK_EQUAL_COLLECTIONS(wire1.begin(), wire1.end(), WIRE, WIRE + sizeof(WIRE));
+
+  Selectors s2(wire1);
+  BOOST_CHECK(!s2.empty());
+  BOOST_CHECK_EQUAL(s2.getMinSuffixComponents(), 2);
+  BOOST_CHECK_EQUAL(s2.getMaxSuffixComponents(), 6);
+  BOOST_CHECK_EQUAL(s2.getPublisherPublicKeyLocator().getType(), KeyLocator::KeyLocator_Name);
+  BOOST_CHECK_EQUAL(s2.getPublisherPublicKeyLocator().getName(), "ndn:/test/key/locator");
+  BOOST_CHECK_EQUAL(s2.getExclude().toUri(), "alex,xxxx,*,yyyy");
+  BOOST_CHECK_EQUAL(s2.getChildSelector(), 1);
+  BOOST_CHECK_EQUAL(s2.getMustBeFresh(), true);
+
+  BOOST_CHECK(s1 == s2);
+}
+
+BOOST_AUTO_TEST_CASE(SetChildSelector)
+{
+  Selectors s;
+  BOOST_CHECK_EQUAL(s.getChildSelector(), 0);
+  BOOST_CHECK_THROW(s.setChildSelector(-1), std::invalid_argument);
+  BOOST_CHECK_THROW(s.setChildSelector(2), std::invalid_argument);
+  s.setChildSelector(1);
+  BOOST_CHECK_EQUAL(s.getChildSelector(), 1);
+  s.setChildSelector(0);
+  BOOST_CHECK_EQUAL(s.getChildSelector(), 0);
+}
+
+BOOST_AUTO_TEST_CASE(Equality)
+{
+  // Selectors ::= SELECTORS-TYPE TLV-LENGTH
+  //                 MinSuffixComponents?
+  //                 MaxSuffixComponents?
+  //                 PublisherPublicKeyLocator?
+  //                 Exclude?
+  //                 ChildSelector?
+  //                 MustBeFresh?
+
+  Selectors a;
+  Selectors b;
+  BOOST_CHECK_EQUAL(a == b, true);
+  BOOST_CHECK_EQUAL(a != b, false);
+
+  // MinSuffixComponents
+  a.setMinSuffixComponents(1);
+  BOOST_CHECK_EQUAL(a == b, false);
+  BOOST_CHECK_EQUAL(a != b, true);
+
+  b.setMinSuffixComponents(2);
+  BOOST_CHECK_EQUAL(a == b, false);
+  BOOST_CHECK_EQUAL(a != b, true);
+
+  b.setMinSuffixComponents(1);
+  BOOST_CHECK_EQUAL(a == b, true);
+  BOOST_CHECK_EQUAL(a != b, false);
+
+  // MaxSuffixComponents
+  a.setMaxSuffixComponents(10);
+  BOOST_CHECK_EQUAL(a == b, false);
+  BOOST_CHECK_EQUAL(a != b, true);
+
+  b.setMaxSuffixComponents(10);
+  BOOST_CHECK_EQUAL(a == b, true);
+  BOOST_CHECK_EQUAL(a != b, false);
+
+  // PublisherPublicKeyLocator
+  a.setPublisherPublicKeyLocator(KeyLocator("/key/Locator/name"));
+  BOOST_CHECK_EQUAL(a == b, false);
+  BOOST_CHECK_EQUAL(a != b, true);
+
+  b.setPublisherPublicKeyLocator(KeyLocator("/key/Locator/name"));
+  BOOST_CHECK_EQUAL(a == b, true);
+  BOOST_CHECK_EQUAL(a != b, false);
+
+  // Exclude
+  a.setExclude(Exclude().excludeOne(name::Component("exclude")));
+  BOOST_CHECK_EQUAL(a == b, false);
+  BOOST_CHECK_EQUAL(a != b, true);
+
+  b.setExclude(Exclude().excludeOne(name::Component("exclude")));
+  BOOST_CHECK_EQUAL(a == b, true);
+  BOOST_CHECK_EQUAL(a != b, false);
+
+  // ChildSelector
+  a.setChildSelector(1);
+  BOOST_CHECK_EQUAL(a == b, false);
+  BOOST_CHECK_EQUAL(a != b, true);
+
+  b.setChildSelector(1);
+  BOOST_CHECK_EQUAL(a == b, true);
+  BOOST_CHECK_EQUAL(a != b, false);
+
+  // MustBeFresh
+  a.setMustBeFresh(true);
+  BOOST_CHECK_EQUAL(a == b, false);
+  BOOST_CHECK_EQUAL(a != b, true);
+
+  b.setMustBeFresh(true);
+  BOOST_CHECK_EQUAL(a == b, true);
+  BOOST_CHECK_EQUAL(a != b, false);
+}
+
+BOOST_AUTO_TEST_SUITE_END() // TestSelectors
+
+} // namespace tests
+} // namespace ndn
