homescreenapp/hsutils/tsrc/t_hsutils/src/t_hsmenudialogfactory.cpp
changeset 96 458d8c8d9580
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/hsutils/tsrc/t_hsutils/src/t_hsmenudialogfactory.cpp	Mon Oct 04 00:07:25 2010 +0300
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <QString>
+#include <QScopedPointer>
+
+#include <HbGlobal>
+#include <HbAction>
+#include <HbMessageBox>
+#include "hsmenudialogfactory.h"
+#include "t_hsutils.h"
+
+
+#ifdef ONLY_MENU_TESTCASES
+
+void t_hsUtils::testMenuDialogFactoryCreate()
+{
+    HsMenuDialogFactory hsMenuDialogFactory;
+    const QString message("testMessage");
+    QScopedPointer<HbMessageBox> box(
+            hsMenuDialogFactory.create(message, HsMenuDialogFactory::OkCancel));
+
+    QVERIFY(box);
+    QCOMPARE(box->text(), message);
+    QCOMPARE(box->actions().count(), 2);
+    QCOMPARE(box->actions().at(HsMenuDialogFactory::acceptActionIndex())->text(),
+             hbTrId("txt_common_button_ok"));
+    QCOMPARE(box->actions().at(HsMenuDialogFactory::rejectActionIndex())->text(),
+             hbTrId("txt_common_button_cancel"));
+
+    box.reset(
+            hsMenuDialogFactory.create(message, HsMenuDialogFactory::Close));
+
+    QVERIFY(box);
+    QCOMPARE(box->text(), message);
+    QCOMPARE(box->actions().count(), 1);
+    QCOMPARE(box->actions().at(HsMenuDialogFactory::acceptActionIndex())->text(),
+             hbTrId("txt_common_button_close"));
+}
+#endif