From db1e2f066393af3e58814417de5bbe7ea08a145d Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 31 Dec 2015 04:04:31 +0000 Subject: Basics working, could do with a tidy up around mocking --- libmysqlpp/embeddedmy-mock.h | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'libmysqlpp/embeddedmy-mock.h') diff --git a/libmysqlpp/embeddedmy-mock.h b/libmysqlpp/embeddedmy-mock.h index 0b90b4b..cad10eb 100644 --- a/libmysqlpp/embeddedmy-mock.h +++ b/libmysqlpp/embeddedmy-mock.h @@ -4,26 +4,30 @@ #include #include #include +#include +#include "embeddedmy-server.h" namespace MySQL { -namespace Embedded { + namespace Embedded { + class DLL_PUBLIC Mock : public DB::MockDatabase { + public: + Mock(const std::string & name, const std::vector & ss); + ~Mock(); -class DLL_PUBLIC Mock : public DB::MockDatabase { - public: - Mock(const std::string & name, const std::vector & ss); - ~Mock(); + protected: + void DropDatabase() const override; + void CreateNewDatabase() const override; - protected: - void DropDatabase() const override; - void CreateNewDatabase() const override; + DB::Connection * openConnection() const override; - DB::Connection * openConnection() const override; + private: + static boost::filesystem::path mockDbPath(); - private: - const boost::filesystem::path testDbPath; -}; + std::string dbname; + mutable ServerPtr embeddedServer; + }; -} + } } #endif -- cgit v1.2.3