EditorTestCase: How to test that an intention is not applicable



I'm currently testing intentions of my project by using EditorTestCases.

It's easy to test against the outcome of an intention invocation, but now I need to test that an intention is NOT applicable in a specific context and I can't find an elegant solution for this problem.

Does anybody know a good approach to test this in MPS?


Thank you in advance and best regards


Comment actions Permalink

IntentionsManager.getInstance().getAvailableIntentions(...) will provide the intentions available on that given node and editorcontext. 

Comment actions Permalink

Thank you very much.

I've found another alternative for this kind of test case. You can just use this expression in your EditorTestCase:

is intention applicable <intention> ;

This will return a boolean value whether the intention is applicable or not.


Please sign in to leave a comment.