peek: Refactor ndnpeek and add unit tests

Change-Id: Ib34c4431bdc268c5a7ef2fccf0946b0d19d69ab6
Refs: #3558
diff --git a/tests/test-common.cpp b/tests/test-common.cpp
index 5461f6f..37d9d99 100644
--- a/tests/test-common.cpp
+++ b/tests/test-common.cpp
@@ -111,6 +111,14 @@
 }
 
 lp::Nack
+makeNack(const Interest& interest, lp::NackReason reason)
+{
+  lp::Nack nack(interest);
+  nack.setReason(reason);
+  return nack;
+}
+
+lp::Nack
 makeNack(const Name& name, uint32_t nonce, lp::NackReason reason)
 {
   Interest interest(name);