Simplified doc-site generation
[AGL/documentation.git] / docs / 4_APIs_and_Services / 4.4_AGL_Test_Framework / 5_Reference / 2_BindingAssertFunctions / 2_BindingAssertFunctions.md
1 ---
2 edit_link: ''
3 title: Binding Assert Functions
4 origin_url: >-
5   https://git.automotivelinux.org/apps/app-afb-test/plain/docs/Reference/1_BindingAssertFunctions.md?h=master
6 ---
7
8 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/apis_services/master/app-afb-test-developer-guides-api-services-book.yml -->
9
10 # Binding Assert functions
11
12 * **_AFT.assertVerbStatusSuccess(api, verb, args)**
13
14     Simply test that the call of a verb successfully returns.
15
16 * **_AFT.assertVerbStatusError(api, verb, args)**
17
18     The inverse than above.
19
20 * **_AFT.assertVerbStatusSkipped(api, verb, args, msg)**
21
22     Skip a test.
23
24     *msg* must contain your test name if you want to parse the output.
25
26 * **_AFT.assertVerbResponseEquals(api, verb, args, expectedResponse)**
27
28     Test that the call of a verb successfully returns and that verb's response
29     is equals to the *expectedResponse*.
30
31 * **_AFT.assertVerbResponseEqualsError(api, verb, args, expectedResponse)**
32
33     The inverse than above.
34
35 * **_AFT.assertVerbCb(api, verb, args, expectedResponse, callback)**
36
37     Test the call of a verb with a custom callback. From this callback you
38     will need to make some assertions on what you need (verb JSON return object
39     content mainly).
40
41     If you don't need to test the response simply specify an empty LUA table.
42
43 * **_AFT.assertVerbCbError(api, verb, args, expectedResponse, callback)**
44
45     Should return success on failure.
46
47 * **_AFT.assertEvtReceived(eventName, timeout)**
48
49     Prior to be able to check that an event has been received, you have to
50     register the event with the test framework using **_AFT.addEventToMonitor**
51     function.
52
53     Check if an event has been correctly received in time (timeout in µs).
54     An event name use the application framework naming scheme: **api/event_name**.
55
56 * **_AFT.assertEvtNotReceived(eventName, timeout)**
57
58     Prior to be able to check that an event has been received, you have to
59     register the event with the test framework using **_AFT.addEventToMonitor**
60     function.
61
62     Check if an event has been correctly received in time (timeout in µs).
63     An event name use the application framework naming scheme: **api/event_name**.
64
65 * **_AFT.assertGrpEvtReceived(eventGrp, timeout)**
66
67     Prior to be able to check that a group of event (a table of event) has been
68     received, you have to register the event with the test framework using
69     **_AFT.addEventToMonitor** function.
70
71     The table has to have this format:
72  ```lua
73     eventGrp = {["api/event_name_1"]=1,["api/event_name_2"]=2,["api/event_name_3"]=5}
74  ```
75     As you can see, in the table, event names are table keys and the value stored are
76     the number of time that the events have to be received.
77
78     Check if events has been correctly received in time (timeout in µs).
79     An event name use the application framework naming scheme: **api/event_name**.