summaryrefslogtreecommitdiff
path: root/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc')
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc
index dd4c6fd526..bd4c5c1ec6 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc
@@ -209,9 +209,7 @@ TEST_F(DeleteInteractionChoiceSetRequestTest,
EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
.WillOnce(Return(invalid_choice_set_id));
- EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
- EXPECT_CALL(*app_, RemoveChoiceSet(kChoiceSetId));
- EXPECT_CALL(*app_, UpdateHash());
+ EXPECT_CALL(*app_, app_id()).Times(0);
}
DeleteInteractionChoiceSetRequestPtr command =
@@ -222,8 +220,13 @@ TEST_F(DeleteInteractionChoiceSetRequestTest,
}
TEST_F(DeleteInteractionChoiceSetRequestTest, Run_SendVrDeleteCommand_SUCCESS) {
+ using namespace application_manager;
+ using namespace event_engine;
+
(*message_)[am::strings::params][am::strings::connection_key] =
kConnectionKey;
+ (*message_)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
(*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
kChoiceSetId;
(*message_)[am::strings::msg_params][am::strings::grammar_id] = kGrammarId;
@@ -232,6 +235,10 @@ TEST_F(DeleteInteractionChoiceSetRequestTest, Run_SendVrDeleteCommand_SUCCESS) {
smart_objects::SmartObject choice_set_id =
(*message_)[am::strings::msg_params];
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::VR_DeleteCommand);
+ event.set_smart_object(*message_);
+
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillRepeatedly(Return(app_));
@@ -246,21 +253,27 @@ TEST_F(DeleteInteractionChoiceSetRequestTest, Run_SendVrDeleteCommand_SUCCESS) {
EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
.WillOnce(Return(choice_set_id));
- EXPECT_CALL(*app_, app_id())
- .WillOnce(Return(kConnectionKey))
- .WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
+ }
+
+ EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
+
+ {
+ InSequence seq;
EXPECT_CALL(*app_, RemoveChoiceSet(kChoiceSetId));
EXPECT_CALL(*app_, UpdateHash());
}
- EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true));
- EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _));
+ EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _))
+ .WillOnce(Return(true));
DeleteInteractionChoiceSetRequestPtr command =
CreateCommand<DeleteInteractionChoiceSetRequest>(message_);
command->Init();
command->Run();
+
+ command->on_event(event);
}
TEST_F(DeleteInteractionChoiceSetResponseTest, Run_SuccessFalse_UNSUCCESS) {