From 51f5287f5328396a11c2985903c12d4cfc1bb298 Mon Sep 17 00:00:00 2001
From: Thomas Moulard <thomas.moulard@gmail.com>
Date: Tue, 21 Dec 2010 00:21:12 +0100
Subject: [PATCH] Enhance Entity test case.

---
 tests/entity.cpp | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/tests/entity.cpp b/tests/entity.cpp
index 467503f..f1e8e17 100644
--- a/tests/entity.cpp
+++ b/tests/entity.cpp
@@ -159,6 +159,28 @@ BOOST_AUTO_TEST_CASE (commandLine_signalDep)
   BOOST_CHECK (output.is_empty ());
 }
 
+BOOST_AUTO_TEST_CASE (commandLine_unknown)
+{
+  dynamicgraph::Entity entity ("my-entity");
+
+  output_test_stream output;
+
+  std::istringstream args;
+
+  try
+    {
+      entity.commandLine("unknown", args, output);
+    }
+  catch (dynamicgraph::ExceptionFactory& exception)
+    {
+      //FIXME: getCode should be const.
+      BOOST_CHECK_EQUAL (exception.getCode (),
+			 dynamicgraph::ExceptionFactory::UNREFERED_FUNCTION);
+    }
+
+  BOOST_CHECK (output.is_empty ());
+}
+
 BOOST_AUTO_TEST_CASE (writeGraph)
 {
   dynamicgraph::Entity entity ("my-entity");
-- 
GitLab