41 lines
940 B
C++
41 lines
940 B
C++
#include <gmock/gmock.h>
|
|
|
|
#include <eedb/db/data/PgAuthIdentity.hpp>
|
|
|
|
#include <utils/DbTestBase.hpp>
|
|
|
|
class PgAuthIdentityTest : public DbTestBase< PgAuthIdentityTest > {
|
|
public:
|
|
PgAuthIdentityTest() {
|
|
using namespace testing;
|
|
db().native()->start_transaction();
|
|
}
|
|
|
|
void initCached() {
|
|
sut = std::make_unique< eedb::PgAuthIdentity >(db(), "identity", "provider");
|
|
}
|
|
|
|
~PgAuthIdentityTest() {
|
|
db().native()->rollback_transaction(false);
|
|
}
|
|
|
|
protected:
|
|
std::unique_ptr< eedb::PgAuthIdentity > sut;
|
|
};
|
|
|
|
template <>
|
|
std::unique_ptr< PgTestDatabasePrepare > DbTestBase< PgAuthIdentityTest >::_test_db = {};
|
|
|
|
using namespace sqlpp;
|
|
using namespace std::chrono;
|
|
|
|
TEST_F(PgAuthIdentityTest, hasIdentity) {
|
|
initCached();
|
|
EXPECT_TRUE(sut->identity() == "identity");
|
|
}
|
|
|
|
TEST_F(PgAuthIdentityTest, hasProvider) {
|
|
initCached();
|
|
EXPECT_TRUE(sut->provider() == "provider");
|
|
}
|