face+util: Add protected Face::getTransport method and simplify DummyClientFace implementation

Change-Id: I42e7e5705f27b6823ed18107b374c9841d2a7500
Refs: #3146
diff --git a/tests/unit-tests/face.t.cpp b/tests/unit-tests/face.t.cpp
index ccd7df4..43164a6 100644
--- a/tests/unit-tests/face.t.cpp
+++ b/tests/unit-tests/face.t.cpp
@@ -23,6 +23,7 @@
 #include "util/scheduler.hpp"
 #include "security/key-chain.hpp"
 #include "util/dummy-client-face.hpp"
+#include "transport/tcp-transport.hpp"
 
 #include "boost-test.hpp"
 #include "unit-test-time-fixture.hpp"
@@ -595,6 +596,22 @@
   // should not segfault
 }
 
+BOOST_AUTO_TEST_CASE(FaceTransport)
+{
+  KeyChain keyChain;
+
+  BOOST_CHECK(Face().getTransport() != nullptr);
+
+  BOOST_CHECK(Face(shared_ptr<Transport>()).getTransport() == nullptr);
+  BOOST_CHECK(Face(shared_ptr<Transport>(), io).getTransport() == nullptr);
+  BOOST_CHECK(Face(shared_ptr<Transport>(), io, keyChain).getTransport() == nullptr);
+
+  auto transport = make_shared<TcpTransport>("localhost", "6363"); // no real io operations will be scheduled
+  BOOST_CHECK(Face(transport).getTransport() == transport);
+  BOOST_CHECK(Face(transport, io).getTransport() == transport);
+  BOOST_CHECK(Face(transport, io, keyChain).getTransport() == transport);
+}
+
 BOOST_AUTO_TEST_SUITE_END()
 
 } // tests