add name assignment config test

Change-Id: Idc2078637ff0a156560953b139ec84f21fdf2617
diff --git a/tests/unit-tests/config-files/config-ca-5 b/tests/unit-tests/config-files/config-ca-5
index 9907902..5e05b29 100644
--- a/tests/unit-tests/config-files/config-ca-5
+++ b/tests/unit-tests/config-files/config-ca-5
@@ -21,5 +21,9 @@
         "ca-prefix": "/ndn/edu/irl",
         "certificate": "Bv0CJAcsCANuZG4IBXNpdGUxCANLRVkICBG8IvRjFf8XCARzZWxmCAn9AAABWcgU2aUUCRgBAhkEADbugBX9AU8wggFLMIIBAwYHKoZIzj0CATCB9wIBATAsBgcqhkjOPQEBAiEA/////wAAAAEAAAAAAAAAAAAAAAD///////////////8wWwQg/////wAAAAEAAAAAAAAAAAAAAAD///////////////wEIFrGNdiqOpPns+u9VXaYhrxlHQawzFOw9jvOPD4n0mBLAxUAxJ02CIbnBJNqZnjhE50mt4GffpAEQQRrF9Hy4SxCR/i85uVjpEDydwN9gS3rM6D0oTlF2JjClk/jQuL+Gn+bjufrSnwPnhYrzjNXazFezsu2QGg3v1H1AiEA/////wAAAAD//////////7zm+q2nF56E87nKwvxjJVECAQEDQgAES9Cb9iANUNYmwt5bjwNW1mZgjzIkDJb6FTCdiYWnkMMIVxh2YDllphoWDEAPS6kqJczzCuhnGYpZCp9tTaYKGxZMGwEDHB0HGwgDbmRuCAVzaXRlMQgDS0VZCAgRvCL0YxX/F/0A/Sb9AP4PMTk3MDAxMDFUMDAwMDAw/QD/DzIwMzcwMTE3VDIxMjg0NhdIMEYCIQDXkR1hF3GiP7yLXq+0JBJfi9QC+hhAu/1Bykx+MWz6RAIhANwelBTxxZr2C5bD15mjfhWudK4I1tOb4b/9xWCHyM7F"
       }
-  ]
+  ],
+  "name-assignment":
+  {
+     "param": "email"
+  }
 }
\ No newline at end of file
diff --git a/tests/unit-tests/config-files/config-ca-6 b/tests/unit-tests/config-files/config-ca-6
new file mode 100644
index 0000000..37c9d37
--- /dev/null
+++ b/tests/unit-tests/config-files/config-ca-6
@@ -0,0 +1,18 @@
+{
+  "ca-prefix": "/ndn",
+  "ca-info": "ndn testbed ca",
+  "max-validity-period": "864000",
+  "max-suffix-length": 3,
+  "probe-parameters":
+  [
+      { "probe-parameter-key": "full name" }
+  ],
+  "supported-challenges":
+  [
+      { "challenge": "PIN" }
+  ],
+  "name-assignment":
+  {
+    "nonexistent": ""
+  }
+}
\ No newline at end of file
diff --git a/tests/unit-tests/configuration.t.cpp b/tests/unit-tests/configuration.t.cpp
index d7cb506..98951c1 100644
--- a/tests/unit-tests/configuration.t.cpp
+++ b/tests/unit-tests/configuration.t.cpp
@@ -54,6 +54,11 @@
   config.load("tests/unit-tests/config-files/config-ca-5");
   BOOST_CHECK_EQUAL(config.m_redirection->at(0)->getName(),
                     "/ndn/site1/KEY/%11%BC%22%F4c%15%FF%17/self/%FD%00%00%01Y%C8%14%D9%A5");
+
+  std::vector<std::tuple<std::string, std::string>> params;
+  params.emplace_back("email", "1@1.edu");
+  BOOST_CHECK_EQUAL(config.m_nameAssignmentFunc(params).size(), 1);
+  BOOST_CHECK_EQUAL(config.m_nameAssignmentFunc(params)[0], Name("1@1.edu"));
 }
 
 BOOST_AUTO_TEST_CASE(CAConfigFileWithErrors)
@@ -65,6 +70,8 @@
   BOOST_CHECK_THROW(config.load("tests/unit-tests/config-files/config-ca-3"), std::runtime_error);
   // unsupported challenge
   BOOST_CHECK_THROW(config.load("tests/unit-tests/config-files/config-ca-4"), std::runtime_error);
+  // unsupported name assignment
+  BOOST_CHECK_THROW(config.load("tests/unit-tests/config-files/config-ca-6"), std::runtime_error);
 }
 
 BOOST_AUTO_TEST_CASE(RequesterCaCacheFile)