File indexing completed on 2024-04-14 03:50:39

0001 /*
0002   This file is part of the kcalcore library.
0003 
0004   SPDX-FileCopyrightText: 2003 Cornelius Schumacher <schumacher@kde.org>
0005 
0006   SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 #include "event.h"
0010 #include "icalformat.h"
0011 
0012 #include <QDebug>
0013 #include <QTest>
0014 #include <qtest.h>
0015 
0016 using namespace KCalendarCore;
0017 
0018 class TestToString : public QObject
0019 {
0020     Q_OBJECT
0021 private Q_SLOTS:
0022     void testToString()
0023     {
0024         Event::Ptr ev = Event::Ptr(new Event);
0025         ev->setSummary(QStringLiteral("Griazi"));
0026         ICalFormat iformat;
0027         QString icalstr = iformat.toICalString(ev);
0028 
0029         Incidence::Ptr ev2 = iformat.fromString(icalstr);
0030         QVERIFY(ev2);
0031         QCOMPARE(ev2->summary(), QLatin1String("Griazi"));
0032     }
0033 };
0034 
0035 QTEST_APPLESS_MAIN(TestToString)
0036 
0037 #include "testtostring.moc"