--- /dev/null
+/*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ Pekka Nissinen - pekka.nissinen@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 "../../../src/ui/zoombuttonpanel.h"
+
+class TestZoomButtonPanel : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ /**
+ * @brief Test case for initialization
+ */
+ void init();
+
+ /**
+ * @brief Test case for disabling Zoom In button
+ */
+ void disableZoomIn();
+
+ /**
+ * @brief Test case for disabling Zoom Out button
+ */
+ void disableZoomOut();
+
+ /**
+ * @brief Test case for resetting buttons
+ */
+ void reset();
+};
+
+void TestZoomButtonPanel::init()
+{
+ // Create a new instance of ZoomButtonPanel
+ ZoomButtonPanel zoomButtonPanel(0, 10, 10);
+
+ // Check that panel is positioned to the right place
+ QCOMPARE(zoomButtonPanel.pos(), QPoint(10, 10));
+
+ // Check that both of the buttons images are loaded successfully
+ QVERIFY(zoomButtonPanel.m_zoomInButton != 0);
+ QVERIFY(zoomButtonPanel.m_zoomOutButton != 0);
+
+ // Check that both of the button icons are at normal mode
+ QVERIFY(zoomButtonPanel.m_zoomInButton->mode() == QIcon::Normal);
+ QVERIFY(zoomButtonPanel.m_zoomOutButton->mode() == QIcon::Normal);
+}
+
+void TestZoomButtonPanel::disableZoomIn()
+{
+ // Create a new instance of ZoomButtonPanel
+ ZoomButtonPanel zoomButtonPanel(0, 0, 0);
+
+ // Disable the button
+ zoomButtonPanel.disableZoomInButton();
+
+ // Check that Zoom In button is disabled
+ QVERIFY(zoomButtonPanel.m_zoomInButton->mode() == QIcon::Disabled);
+}
+
+void TestZoomButtonPanel::disableZoomOut()
+{
+ // Create a new instance of ZoomButtonPanel
+ ZoomButtonPanel zoomButtonPanel(0, 0, 0);
+
+ // Disable the button
+ zoomButtonPanel.disableZoomOutButton();
+
+ // Check that Zoom In button is disabled
+ QVERIFY(zoomButtonPanel.m_zoomOutButton->mode() == QIcon::Disabled);
+}
+
+void TestZoomButtonPanel::reset()
+{
+ // Create a new instance of ZoomButtonPanel
+ ZoomButtonPanel zoomButtonPanel(0, 0, 0);
+
+ // Set both buttons to disabled mode
+ zoomButtonPanel.m_zoomInButton->setMode(QIcon::Disabled);
+ zoomButtonPanel.m_zoomOutButton->setMode(QIcon::Disabled);
+
+ // Reset the buttons
+ zoomButtonPanel.resetButtons();
+
+ // Check that both buttons are properly resetted to normal mode
+ QVERIFY(zoomButtonPanel.m_zoomInButton->mode() == QIcon::Normal);
+ QVERIFY(zoomButtonPanel.m_zoomOutButton->mode() == QIcon::Normal);
+}
+
+QTEST_MAIN(TestZoomButtonPanel)
+#include "testzoombuttonpanel.moc"