2016-05-12 14:08:58 +08:00
|
|
|
#ifndef MAINTEST_H
|
|
|
|
|
#define MAINTEST_H
|
|
|
|
|
|
|
|
|
|
#include <QtCore/QObject>
|
|
|
|
|
#include <QtCore/qglobal.h>
|
|
|
|
|
|
|
|
|
|
#include "weblogdatabase.h"
|
2016-05-21 16:09:03 +08:00
|
|
|
class Post;
|
2018-01-11 15:13:01 +08:00
|
|
|
class User;
|
2016-05-12 14:08:58 +08:00
|
|
|
class MainTest : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
WeblogDatabase db;
|
|
|
|
|
int postId;
|
2016-05-21 16:09:03 +08:00
|
|
|
Post *post;
|
2018-01-11 17:36:48 +08:00
|
|
|
User *user;
|
2018-01-09 17:33:54 +08:00
|
|
|
|
2016-05-12 14:08:58 +08:00
|
|
|
public:
|
|
|
|
|
explicit MainTest(QObject *parent = 0);
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void initTestCase();
|
|
|
|
|
|
|
|
|
|
void dataScheema();
|
2018-01-11 15:13:01 +08:00
|
|
|
void createUser();
|
2016-05-12 14:08:58 +08:00
|
|
|
void createPost();
|
2016-06-05 20:22:26 +08:00
|
|
|
void createPost2();
|
2018-02-26 14:47:05 +08:00
|
|
|
void selectPublicts();
|
2018-01-14 04:43:51 +08:00
|
|
|
void join();
|
2016-05-12 14:08:58 +08:00
|
|
|
void selectPosts();
|
2018-01-16 04:04:42 +08:00
|
|
|
void selectScoreAverage();
|
2018-01-12 00:14:29 +08:00
|
|
|
void selectFirst();
|
2016-06-05 20:22:26 +08:00
|
|
|
void selectPostsWithoutTitle();
|
2017-09-10 22:18:20 +08:00
|
|
|
void selectPostIds();
|
2018-02-27 00:31:51 +08:00
|
|
|
void updatePostOnTheFly();
|
2016-05-21 16:09:03 +08:00
|
|
|
void testDate();
|
2016-05-12 14:08:58 +08:00
|
|
|
void selectWithInvalidRelation();
|
|
|
|
|
void modifyPost();
|
2017-08-09 21:19:35 +08:00
|
|
|
void emptyDatabase();
|
2016-05-12 14:08:58 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // MAINTEST_H
|