diff options
author | Sergey Levchenko (GitHub) <slevchenko.work@gmail.com> | 2016-11-22 17:31:09 +0200 |
---|---|---|
committer | dcherniev <dcherniev@github.com> | 2016-11-24 11:41:12 +0200 |
commit | 9d8e4a3be9546e804fb0fcbeb43455e321f05c5a (patch) | |
tree | 0445d83918c6510ad2356212027d87842c084f10 | |
parent | cd9c239076b02435572a2753abc25d848d833cfd (diff) | |
download | sdl_core-9d8e4a3be9546e804fb0fcbeb43455e321f05c5a.tar.gz |
Fix issues related to MockMessageHelper
Added missed expectations
Related to: APPLINK-30284
-rw-r--r-- | src/components/application_manager/test/commands/mobile/speak_request_test.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/components/application_manager/test/commands/mobile/speak_request_test.cc b/src/components/application_manager/test/commands/mobile/speak_request_test.cc index 5d23120943..d779faae06 100644 --- a/src/components/application_manager/test/commands/mobile/speak_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/speak_request_test.cc @@ -75,8 +75,15 @@ using ::test::components::application_manager_test::MockApplication; class SpeakRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { public: SpeakRequestTest() - : request_(CreateMessage(smart_objects::SmartType_Map)) - , response_(CreateMessage(smart_objects::SmartType_Map)) {} + : mock_message_helper_(*am::MockMessageHelper::message_helper_mock()) + , request_(CreateMessage(smart_objects::SmartType_Map)) + , response_(CreateMessage(smart_objects::SmartType_Map)) { + testing::Mock::VerifyAndClearExpectations(&mock_message_helper_); + } + + ~SpeakRequestTest() { + testing::Mock::VerifyAndClearExpectations(&mock_message_helper_); + } MessageSharedPtr ManageResponse() { return response_; @@ -126,6 +133,8 @@ class SpeakRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { static_cast<int32_t>(mobile_response)); } + am::MockMessageHelper& mock_message_helper_; + private: MessageSharedPtr request_; MessageSharedPtr response_; @@ -147,6 +156,9 @@ TEST_F(SpeakRequestTest, OnEvent_SUCCESS_Expect_true) { MessageSharedPtr response_to_mobile; + EXPECT_CALL(mock_message_helper_, + HMIToMobileResult(hmi_apis::Common_Result::SUCCESS)) + .WillOnce(Return(mobile_apis::Result::SUCCESS)); EXPECT_CALL( app_mngr_, ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) |