00001 /*************************************************************************** 00002 * Copyright (C) 2007 by Tim Sutton * 00003 * tim@linfiniti.com * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 #include <QtTest/QtTest> 00021 #include <omgtip.h> 00022 #include <omgtipfactory.h> 00023 00024 class OmgTipFactoryTest: public QObject 00025 { 00026 Q_OBJECT; 00027 private slots: 00028 void getGuiTip(); 00029 void getGenericTip(); 00030 void getTip(); 00031 void getTipAtPosition(); 00032 void initTestCase();// will be called before the first testfunction is executed. 00033 void cleanupTestCase();// will be called after the last testfunction was executed. 00034 void init(){};// will be called before each testfunction is executed. 00035 void cleanup(){};// will be called after every testfunction. 00036 private: 00037 OmgTipFactory mFactory; 00038 }; 00039 00040 void OmgTipFactoryTest::initTestCase() 00041 { 00042 QCoreApplication::setOrganizationName("openModeller"); 00043 QCoreApplication::setOrganizationDomain("openmodeller.sf.net"); 00044 QCoreApplication::setApplicationName("OpenModellerGui"); 00045 } 00046 void OmgTipFactoryTest::cleanupTestCase() 00047 { 00048 } 00049 void OmgTipFactoryTest::getGuiTip() 00050 { 00051 QVERIFY(!mFactory.getGuiTip().title().isEmpty()); 00052 QVERIFY(!mFactory.getGuiTip().content().isEmpty()); 00053 00054 } 00055 void OmgTipFactoryTest::getGenericTip() 00056 { 00057 QVERIFY(!mFactory.getGenericTip().title().isEmpty()); 00058 QVERIFY(!mFactory.getGenericTip().content().isEmpty()); 00059 } 00060 void OmgTipFactoryTest::getTip() 00061 { 00062 QVERIFY(!mFactory.getTip().title().isEmpty()); 00063 QVERIFY(!mFactory.getTip().content().isEmpty()); 00064 } 00065 void OmgTipFactoryTest::getTipAtPosition() 00066 { 00067 QVERIFY(!mFactory.getTip(0).title().isEmpty()); 00068 QVERIFY(!mFactory.getTip(0).content().isEmpty()); 00069 } 00070 00071 QTEST_MAIN(OmgTipFactoryTest) 00072 #include "moc_omgtipfactorytest.cxx" 00073 00074 00075