@@ -30,9 +30,8 @@ local common = require('user_modules/sequences/actions')
3030--[[ Test Configuration ]]
3131runner .testSettings .isSelfIncluded = false
3232
33-
3433--[[ Local Variables ]]
35- local responseUiParams = {
34+ local params = {
3635 distanceToManeuver = 50.1 ,
3736 distanceToManeuverScale = 100.2
3837}
@@ -42,13 +41,30 @@ local function ptuFunc(tbl)
4241 tbl .policy_table .app_policies [" 0000001" ].groups = {" Base-4" , " Navigation-1" }
4342end
4443
45- local function checkShowConstantTBT (pParams , pResultTable )
44+ local function checkShowConstantTBTPositive (pParams )
4645 local cid = common .getMobileSession ():SendRPC (" ShowConstantTBT" , pParams )
46+
4747 common .getHMIConnection ():ExpectRequest (" Navigation.ShowConstantTBT" , pParams )
4848 :Do (function (_ , data )
49- common .getHMIConnection ():SendResponse (data .id , data .method , pResultTable . resultCode , {})
49+ common .getHMIConnection ():SendResponse (data .id , data .method , " SUCCESS " , {})
5050 end )
51- common .getMobileSession ():ExpectResponse (cid , pResultTable )
51+
52+ common .getMobileSession ():ExpectResponse (cid , {
53+ success = true ,
54+ resultCode = " SUCCESS"
55+ })
56+ end
57+
58+ local function checkShowConstantTBTNegative (pParams )
59+ local cid = common .getMobileSession ():SendRPC (" ShowConstantTBT" , pParams )
60+
61+ common .getHMIConnection ():ExpectRequest (" Navigation.ShowConstantTBT" , pParams )
62+ :Times (0 )
63+
64+ common .getMobileSession ():ExpectResponse (cid , {
65+ success = false ,
66+ resultCode = " INVALID_DATA"
67+ })
5268end
5369
5470--[[ Scenario ]]
@@ -60,14 +76,13 @@ runner.Step("Activate App", common.activateApp)
6076runner .Step (" PTU" , common .policyTableUpdate , { ptuFunc })
6177
6278runner .Title (" Test" )
63- runner .Step (" Negative check mandatory parameter distanceToManeuver" , checkShowConstantTBT , {{
64- distanceToManeuverScale = responseUiParams .distanceToManeuver
65- }, {success = false , resultCode = " INVALID_DATA" }})
66- runner .Step (" Negative check mandatory parameter distanceToManeuverScale" , checkShowConstantTBT , {{
67- distanceToManeuver = responseUiParams .distanceToManeuver
68- }, {success = false , resultCode = " INVALID_DATA" }})
69- runner .Step (" Positive case for ShowConstantTBT" , checkShowConstantTBT , {responseUiParams
70- , {success = true , resultCode = " SUCCESS" }})
79+ runner .Step (" Negative check mandatory parameter distanceToManeuver" , checkShowConstantTBTNegative , {{
80+ distanceToManeuverScale = params .distanceToManeuver
81+ }})
82+ runner .Step (" Negative check mandatory parameter distanceToManeuverScale" , checkShowConstantTBTNegative , {{
83+ distanceToManeuver = params .distanceToManeuver
84+ }})
85+ runner .Step (" Positive case for ShowConstantTBT" , checkShowConstantTBTPositive , {params })
7186
7287runner .Title (" Postconditions" )
7388runner .Step (" Stop SDL" , common .postconditions )
0 commit comments