You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there,
I have an interface with a method that applies changes to mutable parameters and as far as I can tell the fflib library does not provide the functionality to setup the mock instance in the unit test to apply changes to the input parameters.
If this is indeed not currently available, are there any plans to add this in future? It would be a very useful addition to the library.
Cheers,
Donnie
The text was updated successfully, but these errors were encountered:
Usually you just stub methods so that they return a particular value or throw a particular exception when invoked with the specified set of arguments. But as you've found, there are methods whose job is to mutate the supplied arguments.
Answering allows you to provide your own dummy implementation of these methods, to do things such as:
mutate supplied arguments
use the supplied arguments to derive a return value (e.g. return the supplied String argument, but in upper-case)
So answers are very powerful, just take care to keep your tests naive and self-contained - avoid simply recreating the actual implementation, since we're using mocking to avoid coupling with the real method.
Thanks for getting back so quickly. I'll need to update our version of the fflib library (and merge in a couple of bug fixes applied to the old library our end for the issue raised in #30 and the issue raised in #29, although it looks like the second issue may have also been fixed by you in #42), as we don't have the fflib_Answer class and functionality in our current version.
Hi there,
I have an interface with a method that applies changes to mutable parameters and as far as I can tell the fflib library does not provide the functionality to setup the mock instance in the unit test to apply changes to the input parameters.
If this is indeed not currently available, are there any plans to add this in future? It would be a very useful addition to the library.
Cheers,
Donnie
The text was updated successfully, but these errors were encountered: