How to programmatically activate a command's handler? [message #542487] |
Fri, 25 June 2010 05:15 |
|
I have a command whose handler's "activeWhen" expression evaluates to
true if the selected item(s) adapt to my domain model. I'm unit testing
the code and of course there's no selection and so the command has no
active handler.
Is it possible to programmatically activate the declared handler and
invoke it? I'm thinking of perhaps creating an EvaluationContext with a
List of objects that adapt to my domain model then somehow using it to
activate the handler so I can invoke it. I understand I can create a new
Handler in my test case and use Command.setHandler(IHandler) but that
wouldn't be testing my declared handler. I believe IHandlerService has
some methods that might be of use, e.g. #executeCommandInContext but my
command is not parameterized.
Any ideas?
Craig
|
|
|
|
Powered by
FUDForum. Page generated in 0.03397 seconds