diff options
author | Andrey Oleynik <aoleynik@luxoft.com> | 2017-06-07 18:15:52 +0300 |
---|---|---|
committer | Andrey Oleynik <aoleynik@luxoft.com> | 2017-06-07 18:18:03 +0300 |
commit | 9a18ea234d717fbf05891b533e49daa897c423f1 (patch) | |
tree | 0ae9a628eeb39b71fedb6c768b7ddb834e6c64f5 /src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc | |
parent | 2f0982fbc76a5f5bc756e37508dd95fc0cd84a23 (diff) | |
download | sdl_core-9a18ea234d717fbf05891b533e49daa897c423f1.tar.gz |
Fixes unit tests after hash update logic change
Removes duplicated local instances of hmi_interfaces mock with the one from
base class, fixes missing expectations and updates existing.
Diffstat (limited to 'src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc')
-rw-r--r-- | src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc b/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc index 29c52bb0d5..0291de6258 100644 --- a/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc +++ b/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc @@ -280,7 +280,6 @@ TEST_F(ResetGlobalPropertiesRequestTest, EXPECT_CALL(*mock_app_, reset_vr_help_title()); EXPECT_CALL(*mock_app_, reset_vr_help()); - EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true)); smart_objects::SmartObjectSPtr vr_help = @@ -297,7 +296,6 @@ TEST_F(ResetGlobalPropertiesRequestTest, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS), am::commands::Command::ORIGIN_SDL)); - EXPECT_CALL(*mock_app_, UpdateHash()); command_->on_event(event); } @@ -344,7 +342,6 @@ TEST_F(ResetGlobalPropertiesRequestTest, app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::WARNINGS), am::commands::Command::ORIGIN_SDL)); - EXPECT_CALL(*mock_app_, UpdateHash()); command_->on_event(event); } @@ -368,8 +365,7 @@ TEST_F(ResetGlobalPropertiesResponseTest, Run_Sendmsg_SUCCESS) { command->Run(); } -TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidApp_UNSUCCESS) { - Event event(hmi_apis::FunctionID::UI_SetGlobalProperties); +TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidApp_NoHashUpdate) { (*msg_)[am::strings::params][am::hmi_response::code] = hmi_apis::Common_Result::eType::SUCCESS; @@ -387,22 +383,28 @@ TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidApp_UNSUCCESS) { EXPECT_CALL(*mock_message_helper_, CreateAppVrHelp(_)) .WillOnce(Return(vr_help)); - command_->Run(); + MockAppPtr invalid_app; + EXPECT_CALL(app_mngr_, application(kConnectionKey)) + .WillOnce(Return(mock_app_)) + .WillOnce(Return(invalid_app)); - event.set_smart_object(*msg_); + EXPECT_CALL(*mock_app_, UpdateHash()).Times(0); + + ResetGlobalPropertiesRequestPtr command = + CreateCommand<ResetGlobalPropertiesRequest>(msg_); + command->Run(); + + EXPECT_CALL(*mock_message_helper_, HMIToMobileResult(_)) + .WillRepeatedly(Return(mobile_apis::Result::SUCCESS)); EXPECT_CALL(app_mngr_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS), am::commands::Command::ORIGIN_SDL)); - MockAppPtr invalid_app; - EXPECT_CALL(app_mngr_, application(kConnectionKey)) - .WillOnce(Return(invalid_app)); - - EXPECT_CALL(*mock_app_, UpdateHash()).Times(0); - - command_->on_event(event); + Event event(hmi_apis::FunctionID::UI_SetGlobalProperties); + event.set_smart_object(*msg_); + command->on_event(event); } } // namespace reset_global_properties |