I've got a service with a method that takes two Action
s, one for success and one for failure. Each Action
takes a Result parameter that contains additional information...
void AuthoriseUser(AuthDetails loginDetails,
Action<AuthResult> onSuccess,
Action<AuthResult> onFailure);
I'm writing a unit test for a class that is dependant on that service, and I want to test that this class does the correct things in the onSuccess(...)
and onFailure(...)
callbacks. These are either private or anonymous methods, so how do I setup the mocked service to call either Action?