Class ProgrammableFn
Creates an easily programmable function for testing purposes. Multiple behaviours can be defined. A behaviour consists of a set of arguments and a set of return values. If the function is called with these arguments it will return the programmed return values.
Methods
ProgrammableFn:whenCalled(specification) | Creates a new behaviour entry or extends to one. |
Methods
- ProgrammableFn:whenCalled(specification)
-
Creates a new behaviour entry or extends to one.
The specification is a table, that contains the arguments that must match to
trigger this behaviour and the values that will be returned then.
Both are optional and can be passed like this:
whenCalled{with={1,2}, thenReturn={3}}
Parameters:
- specification