source: src/test/model/eventtest.cpp @ e5bc908

qt5
Last change on this file since e5bc908 was e5bc908, checked in by komarma <komarma@…>, 12 years ago

Creating initial application directory structure.

  • Property mode set to 100644
File size: 664 bytes
Line 
1#include "eventtest.h"
2
3#include <QtTest>
4#include <QSqlDatabase>
5
6#include <event.h>
7
8void EventTest::initTestCase()
9{
10    // Connect to the test database. Ask Mr. Pavelka to generate one for you :)
11    QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
12    db.setDatabaseName("fostem-test.sqlite");
13    QVERIFY(db.open());
14}
15
16void EventTest::getById()
17{
18    Event event = Event::getById(500, 1);
19    QCOMPARE(event.id(), 500);
20    QCOMPARE(event.start(), QDateTime::fromString("Sat Feb 7 11:30:00 2009"));
21    QCOMPARE(event.activityId(), 123);
22
23    // !!! TODO: typeId and languageId
24    QCOMPARE(event.typeId(), 0);
25    QCOMPARE(event.languageId(), 0);
26}
Note: See TracBrowser for help on using the repository browser.