26 lines
536 B
C++
26 lines
536 B
C++
#pragma once
|
|
|
|
#include <gtest/gtest.h>
|
|
#include <memory>
|
|
#include <QString>
|
|
|
|
#include "Pgsql_Connection.h"
|
|
|
|
namespace pgtest {
|
|
|
|
/// Fixture giving every test its own database cloned from the template.
|
|
class DbTest : public ::testing::Test {
|
|
protected:
|
|
void SetUp() override;
|
|
void TearDown() override;
|
|
|
|
Pgsql::Connection& conn() { return *conn_; }
|
|
QString dbName() const { return dbName_; }
|
|
QString dbUrl() const;
|
|
|
|
private:
|
|
QString dbName_;
|
|
std::unique_ptr<Pgsql::Connection> conn_;
|
|
};
|
|
|
|
} // namespace pgtest
|