[Easy-setup] Updated Unittest cases file
authorJay Sharma <jay.sharma@samsung.com>
Mon, 14 Mar 2016 16:16:41 +0000 (21:46 +0530)
committerMadan Lanka <lanka.madan@samsung.com>
Wed, 16 Mar 2016 08:13:38 +0000 (08:13 +0000)
- Updated the UnitTest cases for Mediator RichSDK.

Change-Id: I1cb137ba826ca9681faaa9e81856bc74a10bc173
Signed-off-by: Jay Sharma <jay.sharma@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/5887
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
service/easy-setup/mediator/richsdk/unittests/MediatorRichTest.cpp

index afe86bb..d6e24c7 100644 (file)
@@ -225,8 +225,11 @@ TEST_F(MediatorRichTest, testStartProvisioning)
     remoteEnrollee = EasySetup::getInstance()->createEnrolleeDevice(netInfo, onboardingConn);
     remoteEnrollee->registerEasySetupStatusHandler(&easySetupStatusCallback);
 
-    //calling the APIs
-    EXPECT_NO_THROW(remoteEnrollee->startProvisioning());
+    /*It will throw an exception,
+     * as it will not be able to discover the provisioning resource
+     * in the network
+    */
+    EXPECT_ANY_THROW(remoteEnrollee->startProvisioning());
 }
 
 //startProvisioning [Negative]
@@ -272,9 +275,10 @@ TEST_F(MediatorRichTest, testStopProvisioning)
     remoteEnrollee = EasySetup::getInstance()->createEnrolleeDevice(netInfo, onboardingConn);
     remoteEnrollee->registerEasySetupStatusHandler(&easySetupStatusCallback);
 
-    remoteEnrollee->startProvisioning();
-
-    EXPECT_NO_THROW(remoteEnrollee->stopProvisioning());
+    /* It will throw an exception,
+     * as we are calling stop provisioning api before start provisioning.
+     */
+    EXPECT_ANY_THROW(remoteEnrollee->stopProvisioning());
 }
 
 //stopProvisioning [Negative]