EditorTestCase: How to test that an intention is not applicable

Hi,

 

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

Tobias

2 comments
Comment actions Permalink

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

2
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.

1

Please sign in to leave a comment.