Nut/tests/auto/tst_basic/tst_basic.h

51 lines
956 B
C
Raw Normal View History

2016-05-12 14:08:58 +08:00
#ifndef MAINTEST_H
#define MAINTEST_H
#include <QtCore/QObject>
#include <QtCore/qglobal.h>
#include "weblogdatabase.h"
2020-08-08 15:29:16 +08:00
2016-05-21 16:09:03 +08:00
class Post;
2018-01-11 15:13:01 +08:00
class User;
2019-02-10 22:27:29 +08:00
class BasicTest : public QObject
2016-05-12 14:08:58 +08:00
{
Q_OBJECT
WeblogDatabase db;
int postId;
2019-06-18 23:37:03 +08:00
Nut::Row<Post> post;
Nut::Row<User> user;
2018-01-09 17:33:54 +08:00
2016-05-12 14:08:58 +08:00
public:
2019-02-10 22:27:29 +08:00
explicit BasicTest(QObject *parent = nullptr);
2016-05-12 14:08:58 +08:00
2021-03-14 16:42:04 +08:00
Q_SIGNALS:
2016-05-12 14:08:58 +08:00
2021-03-14 16:42:04 +08:00
private Q_SLOTS:
2016-05-12 14:08:58 +08:00
void initTestCase();
2020-04-28 21:47:25 +08:00
void dataSchema();
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();
void join();
2016-05-12 14:08:58 +08:00
void selectPosts();
2018-01-16 04:04:42 +08:00
void selectScoreAverage();
void selectScoreSum();
void selectScoreCount();
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();
void testLimitedQuery();
2016-05-12 14:08:58 +08:00
void selectWithInvalidRelation();
void modifyPost();
2017-08-09 21:19:35 +08:00
void emptyDatabase();
2018-03-13 15:59:11 +08:00
void cleanupTestCase();
2016-05-12 14:08:58 +08:00
};
#endif // MAINTEST_H