cellular/telephonysettings/xqbindings/psetwrapper/tsrc/ut_psetnetworkwrapper/ut_psetnetworkwrapper.cpp
--- a/cellular/telephonysettings/xqbindings/psetwrapper/tsrc/ut_psetnetworkwrapper/ut_psetnetworkwrapper.cpp Wed Aug 18 10:19:22 2010 +0300
+++ b/cellular/telephonysettings/xqbindings/psetwrapper/tsrc/ut_psetnetworkwrapper/ut_psetnetworkwrapper.cpp Thu Sep 02 21:00:29 2010 +0300
@@ -18,6 +18,7 @@
#include <PsetContainer.h>
#include <mpsetnetworkinfoobs.h>
#include <gsmerror.h>
+#include <mock_cpsetrefreshhandler.h>
#include "ut_psetnetworkwrapper.h"
#include "testutilities.h"
#define private public
@@ -125,6 +126,8 @@
initialize();
m_psetContainerMock = new CPsetContainer();
+ m_refreshHandler = CPSetRefreshHandlerMock::NewL();
+ SmcDefaultValue<CPSetRefreshHandler *>::SetL(m_refreshHandler);
RMobilePhone dummyHandle;
NetworkInfoObserver dummyObserver;
@@ -511,4 +514,33 @@
QVERIFY(verify());
}
+/*!
+ UT_PSetNetworkWrapper::t_AllowRefresh
+ */
+void UT_PSetNetworkWrapper::t_AllowRefresh()
+{
+ TSatRefreshType type;
+ TSatElementaryFiles file;
+ m_refreshHandler->trigerAllowRefresh(type, file);
+}
+
+/*!
+ UT_PSetNetworkWrapper::t_Refresh
+ */
+void UT_PSetNetworkWrapper::t_Refresh()
+{
+ TSatElementaryFiles file;
+ expect("CPsetCustomerServiceProfile::IsNetworkSelectionSupported").returns(KErrNone);
+ m_refreshHandler->trigerRefresh(EFileChangeNotification, KCsp1Ef);
+ QVERIFY(verify());
+
+ expect("CPsetCustomerServiceProfile::IsNetworkSelectionSupported").returns(KErrGeneral);
+ m_refreshHandler->trigerRefresh(EFileChangeNotification, KCsp1Ef);
+ QVERIFY(verify());
+
+ expect("CPsetCustomerServiceProfile::IsNetworkSelectionSupported").times(0);
+ m_refreshHandler->trigerRefresh(EFileChangeNotification, KCsp2Ef);
+ QVERIFY(verify());
+}
+
QTEST_MAIN_S60(UT_PSetNetworkWrapper)