Skip to content

Commit

Permalink
moved test class definition into test file
Browse files Browse the repository at this point in the history
  • Loading branch information
nedvedba committed Nov 11, 2024
1 parent e9bb510 commit 64815fe
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 48 deletions.
46 changes: 0 additions & 46 deletions core/server/TestDatabaseAPI.hpp

This file was deleted.

29 changes: 27 additions & 2 deletions core/server/tests/unit/test_DatabaseAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,44 @@

#define BOOST_TEST_MODULE databaseapi

// Local includes
#include "DatabaseAPI.hpp"

// Local public includes
#include "common/DynaLog.hpp"
#include "common/libjson.hpp"

// Third party includes
#include <curl/curl.h>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem.hpp>
#include <boost/test/unit_test.hpp>

// Standard includes
#include <map>
#include <memory>
#include <string>
#include <vector>
#include <map>

using namespace SDMS::Core;

class TestDatabaseAPI: public DatabaseAPI {
public:
TestDatabaseAPI(const std::string &a_db_url, const std::string &a_db_user,
const std::string &a_db_pass);
~TestDatabaseAPI();

long dbGet(const char *a_url_path,
const std::vector<std::pair<std::string, std::string>> &a_params,
libjson::Value &a_result, LogContext, bool a_log = true);
bool
dbGetRaw(const char *a_url_path,
const std::vector<std::pair<std::string, std::string>> &a_params,
std::string &a_result);
long dbPost(const char *a_url_path,
const std::vector<std::pair<std::string, std::string>> &a_params,
const std::string *a_body, libjson::Value &a_result, LogContext);
};

BOOST_AUTO_TEST_SUITE(DatabaseAPITest)

BOOST_AUTO_TEST_CASE(testing_DatabaseAPIPost) {
Expand Down

0 comments on commit 64815fe

Please sign in to comment.