public:
/**
+ * @brief Unit test class
+ */
+ friend class TestMessageDialog;
+
+ /**
* @brief Constructor
*
- * @param parent Instance of parent widget
+ * @param id message receiver's ID
+ * @param receiver message receiver's name
+ * @param parent QWidget
*/
MessageDialog(const QString &id, const QString &receiver, QWidget *parent = 0);
/**
* @brief Gets users input
*
- * @returns users input
+ * @returns users input as id and message text pair
*/
QPair<QString, QString> input();
--- /dev/null
+/*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ Jussi Laitinen - jussi.laitinen@ixonos.com
+
+ Situare is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ version 2 as published by the Free Software Foundation.
+
+ Situare is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Situare; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ USA.
+*/
+
+#include <QtTest>
+#include <QtGui>
+
+#include "../../../src/ui/messagedialog.h"
+
+class TestMessageDialog: public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void cleanup();
+ void init();
+ void input();
+ void sendButtonPressed();
+
+private:
+ QHash<QString, QString> m_tags;
+ MessageDialog *m_messageDialog;
+};
+
+void TestMessageDialog::cleanup()
+{
+ delete m_messageDialog;
+}
+
+void TestMessageDialog::init()
+{
+ m_messageDialog = new MessageDialog("1", "John Doe");
+ QVERIFY(m_messageDialog);
+}
+
+void TestMessageDialog::input()
+{
+ m_messageDialog->m_messageField->setText("Hello world");
+ QCOMPARE(m_messageDialog->input().first, QString("1"));
+ QCOMPARE(m_messageDialog->input().second, QString("Hello world"));
+}
+
+QTEST_MAIN(TestMessageDialog)
+#include "testmessagedialog.moc"