diff options
Diffstat (limited to 'libdbpp/unittests/testConnection.cpp')
-rw-r--r-- | libdbpp/unittests/testConnection.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libdbpp/unittests/testConnection.cpp b/libdbpp/unittests/testConnection.cpp index f1df3b0..a1ab9f6 100644 --- a/libdbpp/unittests/testConnection.cpp +++ b/libdbpp/unittests/testConnection.cpp @@ -3,6 +3,7 @@ #include <factory.h> #include <connection.h> +#include <pq-command.h> #include <definedDirs.h> #include <fstream> #include <vector> @@ -162,3 +163,21 @@ BOOST_AUTO_TEST_CASE( savepoints ) delete mock; } +BOOST_AUTO_TEST_CASE( commandOptions ) +{ + auto optsDefault = DB::CommandOptionsFactory::createNew("", 1234, {}); + BOOST_REQUIRE(optsDefault); + BOOST_REQUIRE(optsDefault->hash); + BOOST_REQUIRE_EQUAL(1234, *optsDefault->hash); +} + +BOOST_AUTO_TEST_CASE( commandOptionsPq ) +{ + auto optsBase = DB::CommandOptionsFactory::createNew("postgresql", 1234, {}); + BOOST_REQUIRE(optsBase); + auto optsPq = dynamic_cast<PQ::CommandOptions *>(optsBase); + BOOST_REQUIRE(optsPq); + BOOST_REQUIRE(optsBase->hash); + BOOST_REQUIRE_EQUAL(1234, *optsBase->hash); +} + |