From b2c23aa9fe546ddbaf3927834b7d8a50ccfc9900 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 16 Oct 2015 19:56:25 +0100 Subject: Test insert unsupported model type --- slicer/db/testInsert.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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 +#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(cm, db.get(), "converted"), Slicer::UnsupportedModelType); +} + -- cgit v1.2.3