diff options
Diffstat (limited to 'src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc')
-rw-r--r-- | src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc b/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc index ee0662e5c6..90c6409fa8 100644 --- a/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc @@ -63,7 +63,6 @@ namespace am = ::application_manager; using am::commands::AlertManeuverRequest; using am::commands::MessageSharedPtr; using am::event_engine::Event; -using am::MockMessageHelper; typedef SharedPtr<AlertManeuverRequest> CommandPtr; @@ -87,11 +86,6 @@ class AlertManeuverRequestTest MockAppPtr mock_app(CreateMockApp()); ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app)); - MockMessageHelper* mock_message_helper = - MockMessageHelper::message_helper_mock(); - EXPECT_CALL(*mock_message_helper, HMIToMobileResult(_)) - .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE)); - EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillRepeatedly(Return(state)); @@ -145,7 +139,8 @@ TEST_F(AlertManeuverRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) { TEST_F(AlertManeuverRequestTest, Run_ProcessingResult_UNSUCCESS) { MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map); - (*msg)[am::strings::msg_params][am::strings::soft_buttons] = 0; + (*msg)[am::strings::msg_params][am::strings::soft_buttons][0] + [am::strings::text] = "text"; CommandPtr command(CreateCommand<AlertManeuverRequest>(msg)); @@ -158,8 +153,7 @@ TEST_F(AlertManeuverRequestTest, Run_ProcessingResult_UNSUCCESS) { const mobile_apis::Result::eType kProcessingResult = mobile_apis::Result::ABORTED; - EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()), - ProcessSoftButtons(_, _, _, _)) + EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)) .WillOnce(Return(kProcessingResult)); MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command))); @@ -195,7 +189,8 @@ TEST_F(AlertManeuverRequestTest, Run_IsWhiteSpaceExist_UNSUCCESS) { TEST_F(AlertManeuverRequestTest, Run_ProcessingResult_SUCCESS) { MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map); - (*msg)[am::strings::msg_params][am::strings::soft_buttons] = 0; + (*msg)[am::strings::msg_params][am::strings::soft_buttons][0] + [am::strings::text] = "text"; CommandPtr command(CreateCommand<AlertManeuverRequest>(msg)); @@ -205,8 +200,7 @@ TEST_F(AlertManeuverRequestTest, Run_ProcessingResult_SUCCESS) { ON_CALL(app_mngr_, GetPolicyHandler()) .WillByDefault(ReturnRef(policy_interface_)); - EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()), - ProcessSoftButtons(_, _, _, _)) + EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)) .WillOnce(Return(mobile_apis::Result::SUCCESS)); EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_)) @@ -215,8 +209,7 @@ TEST_F(AlertManeuverRequestTest, Run_ProcessingResult_SUCCESS) { EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE)); - EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()), - SubscribeApplicationToSoftButton(_, _, _)); + EXPECT_CALL(mock_message_helper_, SubscribeApplicationToSoftButton(_, _, _)); MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command))); EXPECT_EQ(hmi_apis::FunctionID::Navigation_AlertManeuver, @@ -237,30 +230,30 @@ TEST_F(AlertManeuverRequestTest, OnEvent_ReceivedUnknownEvent_UNSUCCESS) { .asInt())); } -TEST_F(AlertManeuverRequestTest, OnEvent_UNSUPPORTED_RESOURCE_Case1) { +TEST_F(AlertManeuverRequestTest, OnEvent_SUCCESS) { CheckExpectations(hmi_apis::Common_Result::SUCCESS, - mobile_apis::Result::UNSUPPORTED_RESOURCE, + mobile_apis::Result::SUCCESS, am::HmiInterfaces::STATE_AVAILABLE, true); } -TEST_F(AlertManeuverRequestTest, OnEvent_UNSUPPORTED_RESOURCE_Case2) { - CheckExpectations(hmi_apis::Common_Result::SUCCESS, +TEST_F(AlertManeuverRequestTest, OnEvent_UNSUPPORTED_RESOURCE) { + CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE, mobile_apis::Result::UNSUPPORTED_RESOURCE, - am::HmiInterfaces::STATE_NOT_AVAILABLE, - true); + am::HmiInterfaces::STATE_AVAILABLE, + false); } -TEST_F(AlertManeuverRequestTest, OnEvent_UNSUPPORTED_RESOURCE_Case3) { - CheckExpectations(hmi_apis::Common_Result::SUCCESS, - mobile_apis::Result::UNSUPPORTED_RESOURCE, +TEST_F(AlertManeuverRequestTest, OnEvent_WARNINGS) { + CheckExpectations(hmi_apis::Common_Result::WARNINGS, + mobile_apis::Result::WARNINGS, am::HmiInterfaces::STATE_NOT_RESPONSE, true); } -TEST_F(AlertManeuverRequestTest, OnEvent_UNSUPPORTED_RESOURCE_Case4) { +TEST_F(AlertManeuverRequestTest, OnEvent_GENERIC_ERROR) { CheckExpectations(hmi_apis::Common_Result::GENERIC_ERROR, - mobile_apis::Result::UNSUPPORTED_RESOURCE, + mobile_apis::Result::GENERIC_ERROR, am::HmiInterfaces::STATE_NOT_RESPONSE, false); } |