diff options
Diffstat (limited to 'src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc')
-rw-r--r-- | src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc index ff149504fa..87127231be 100644 --- a/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc @@ -39,6 +39,7 @@ #include "application_manager/mock_application_manager.h" #include "application_manager/mock_application.h" #include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/mock_message_helper.h" #include "application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h" #include "interfaces/MOBILE_API.h" #include "application_manager/smart_object_keys.h" @@ -47,8 +48,10 @@ namespace test { namespace components { namespace commands_test { namespace mobile_commands_test { +namespace subscribe_way_points_request { using ::testing::_; +using ::testing::A; using ::testing::Return; using ::testing::ReturnRef; using ::testing::DoAll; @@ -68,17 +71,19 @@ TEST_F(SubscribeWayPointsRequestTest, Run_SUCCESS) { MockAppPtr app(CreateMockApp()); ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app)); - ON_CALL(app_mngr_, IsAppSubscribedForWayPoints(_)) + ON_CALL(app_mngr_, IsAppSubscribedForWayPoints(A<am::ApplicationSharedPtr>())) .WillByDefault(Return(false)); ON_CALL(app_mngr_, IsAnyAppSubscribedForWayPoints()) .WillByDefault(Return(true)); { InSequence dummy; - EXPECT_CALL(app_mngr_, SubscribeAppForWayPoints(_)); + EXPECT_CALL(app_mngr_, + SubscribeAppForWayPoints(A<am::ApplicationSharedPtr>())); EXPECT_CALL(*app, UpdateHash()); } + command->Init(); MessageSharedPtr mobile_result_msg( CatchMobileCommandResult(CallRun(*command))); @@ -94,8 +99,9 @@ TEST_F(SubscribeWayPointsRequestTest, OnEvent_SUCCESS) { Event event(hmi_apis::FunctionID::Navigation_SubscribeWayPoints); MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map)); - (*event_msg)[am::strings::params][am::hmi_response::code] = - mobile_apis::Result::SUCCESS; + const hmi_apis::Common_Result::eType result_code = + hmi_apis::Common_Result::SUCCESS; + (*event_msg)[am::strings::params][am::hmi_response::code] = result_code; (*event_msg)[am::strings::msg_params] = 0; event.set_smart_object(*event_msg); @@ -104,14 +110,19 @@ TEST_F(SubscribeWayPointsRequestTest, OnEvent_SUCCESS) { { InSequence dummy; - EXPECT_CALL(app_mngr_, SubscribeAppForWayPoints(_)); + EXPECT_CALL(app_mngr_, + SubscribeAppForWayPoints(A<am::ApplicationSharedPtr>())); + EXPECT_CALL(mock_message_helper_, HMIToMobileResult(result_code)) + .WillOnce(Return(mobile_apis::Result::SUCCESS)); EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)); EXPECT_CALL(*app, UpdateHash()); } + command->Init(); command->on_event(event); } +} // namespace subscribe_way_points_request } // namespace mobile_commands_test } // namespace commands_test } // namespace components |