/*!
 * This function will be called before the first testfunction is executed.
 */
void Ut_MessageReviver::initTestCase()
{
    groupModel.enableContactChanges(false);
    CommHistory::Group group;
    group.setLocalUid(ACCOUNT_PATH);
    group.setRemoteUids(QStringList() << NUMBER);
    groupModel.addGroup(group);

    CommHistory::EventModel model;

    QSignalSpy commit(&model,
                      SIGNAL(eventsCommitted(const QList<CommHistory::Event>&, bool)));
    CommHistory::Event event;
    event.setType(CommHistory::Event::SMSEvent);
    event.setDirection(CommHistory::Event::Inbound);
    event.setStartTime(QDateTime::currentDateTime());
    event.setEndTime(QDateTime::currentDateTime());
    event.setLocalUid(ACCOUNT_PATH);
    event.setGroupId(group.id());
    event.setRemoteUid(NUMBER);
    event.setFreeText("blah");
    event.setMessageToken("mrtc1");
    model.addEvent(event, false);
    waitSignal(commit, 5000);
}
CommHistory::Event Ut_NotificationManager::createImEvent(const QString& remoteUid, int contactId)
{
    eventId++;
    CommHistory::Event event;
    event.setType(CommHistory::Event::IMEvent);
    event.setDirection(CommHistory::Event::Inbound);
    event.setStartTime(QDateTime::currentDateTime());
    event.setEndTime(QDateTime::currentDateTime());
    event.setLocalUid(DUT_ACCOUNT_PATH);
    event.setRemoteUid(remoteUid);
    event.setFreeText(MESSAGE_TEXT);
    event.setMessageToken(MESSAGE_TEXT + QString::number(eventId));
    event.setContactId(contactId);
    event.setGroupId(1);
    event.setId(eventId);
    return event;
}