Projekt

Allgemein

Profil

Herunterladen als
Herunterladen (1,07 KB) Statistiken
| Zweig: | Revision:
cca98131 Christian Ehringfeld
#ifndef TST_EM
#define TST_EM
#include <QString>
#include <QtTest>
#include <QSqlIndex>
#include "entitymanager.h"
#include "databasemigration.h"
#include "../models.h"

class EmTest : public QObject {
Q_OBJECT

private Q_SLOTS:
4cde82a2 Christian Ehringfeld
// void initTestCase();
// void cleanupTestCase();
cca98131 Christian Ehringfeld
void testCheckDuplicates();
void testBasics();
void init();
void cleanup();
void testFindById();
1ac14ffb Christian Ehringfeld
void testFindByIdOnNull();
cca98131 Christian Ehringfeld
void testFindId();
void testHasChanged();
void testValidate();
void testRelations();
void testRelationTableCreation();
void testInheritedRelations();
37d98e0b Christian Ehringfeld
void testNonCachedInheritedRelations();
cca98131 Christian Ehringfeld
void testDatabaseMigrationTable();
a42de475 Christian Ehringfeld
void testCountEntities();
cca98131 Christian Ehringfeld
void testTableCreation();

private:
CuteEntityManager::EntityManager *e;
void createRelationTables();
void deleteRelationTables();
void containsColumn(QHash<QString, QSharedPointer<QSqlField>> &columns, QString name,
QVariant::Type type = QVariant::UserType, QString tableName = "", bool pk = false);
};
#endif // TST_EM