summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-10-16 19:56:25 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-10-16 19:56:25 +0100
commitb2c23aa9fe546ddbaf3927834b7d8a50ccfc9900 (patch)
tree6dcefbc6e54e69081f02dd9b92d77810e5348a4b
parentCorrect test name (diff)
downloadslicer-b2c23aa9fe546ddbaf3927834b7d8a50ccfc9900.tar.bz2
slicer-b2c23aa9fe546ddbaf3927834b7d8a50ccfc9900.tar.xz
slicer-b2c23aa9fe546ddbaf3927834b7d8a50ccfc9900.zip
Test insert unsupported model type
-rw-r--r--slicer/db/testInsert.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/slicer/db/testInsert.cpp b/slicer/db/testInsert.cpp
index fcea462..6f01d76 100644
--- a/slicer/db/testInsert.cpp
+++ b/slicer/db/testInsert.cpp
@@ -7,6 +7,7 @@
#include "sqlInsertSerializer.h"
#include "sqlSelectDeserializer.h"
#include <types.h>
+#include "exceptions.h"
BOOST_TEST_DONT_PRINT_LOG_VALUE(TestModule::DateTime);
BOOST_TEST_DONT_PRINT_LOG_VALUE(TestModule::IsoDate);
@@ -79,3 +80,10 @@ BOOST_AUTO_TEST_CASE( insert_converted )
BOOST_REQUIRE_EQUAL(st->ts, st2->ts);
}
+BOOST_AUTO_TEST_CASE( insert_unsupportedModel )
+{
+ auto db = DBPtr(DB::MockDatabase::openConnectionTo("pqmock"));
+ TestModule::ClassMap cm;
+ BOOST_REQUIRE_THROW(Slicer::SerializeAny<Slicer::SqlInsertSerializer>(cm, db.get(), "converted"), Slicer::UnsupportedModelType);
+}
+