Ignore:
Timestamp:
12/29/09 18:04:41 (12 years ago)
Author:
komarma <komarma@…>
Branches:
master, qt5
Children:
20a6010
Parents:
e5bc908
Message:

Adding orm module

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/test/model/eventtest.cpp

    re5bc908 r5a73d27  
    33#include <QtTest>
    44#include <QSqlDatabase>
     5
     6#include <QDebug>
    57
    68#include <event.h>
     
    2527    QCOMPARE(event.languageId(), 0);
    2628}
     29
     30void EventTest::colNames()
     31{
     32    QCOMPARE(Event::colName(Event::Id), QString("id"));
     33    QCOMPARE(Event::colName(Event::Conference), QString("xid_conference"));
     34    QCOMPARE(Event::colName(Event::Start), QString("start"));
     35    QCOMPARE(Event::colName(Event::Duration), QString("duration"));
     36    QCOMPARE(Event::colName(Event::Activity), QString("xid_activity"));
     37    QCOMPARE(Event::colName(Event::Type), QString("type"));
     38    QCOMPARE(Event::colName(Event::Language), QString("language"));
     39}
     40
     41void EventTest::storingValues()
     42{
     43    Event event;
     44    QCOMPARE(event.id(), 0);
     45
     46    event.setId(10);
     47    QCOMPARE(event.id(), 10);
     48
     49    event.setConferenceId(20);
     50    QCOMPARE(event.conferenceId(), 20);
     51
     52    event.setStart(QDateTime::fromString("Sat Feb 7 11:30:00 2009"));
     53    QCOMPARE(event.start(), QDateTime::fromString("Sat Feb 7 11:30:00 2009"));
     54
     55    event.setDuration(30);
     56    QCOMPARE(event.duration(), 30);
     57
     58    event.setActivityId(40);
     59    QCOMPARE(event.activityId(), 40);
     60
     61    event.setTypeId(50);
     62    QCOMPARE(event.typeId(), 50);
     63
     64    event.setLanguageId(60);
     65    QCOMPARE(event.languageId(), 60);
     66}
Note: See TracChangeset for help on using the changeset viewer.