Is there a built in Editor Action TestCase for checking that a new file was created with specific contents from an existing file?

Looking through the subclasses of UsefulTestCase, I have found the EditorActionTestCase. This class has the methods doTextTest (checks that an existing file's text is transformed correctly under an editor action) and doFileTest (appears to do the same thing, with the added flexibility of defining the expected text in another file).

I have a Java-based plugin that generates a new class in a seperate package than the existing class with an action. I would like to test that the generated file both exists and contains expected text. I presume that IntelliJ itsself has similar tests, but I can't seem to find any.

Thanks.

2 comments
Comment actions Permalink

Use CodeInsightFixtureTestCase as the base class for your test and use CodeInsightTestFixture.checkResultByFile() to verify the result.

0
Comment actions Permalink

Been busy but just had a chance to check this answe -, all good. Thanks Dmitry!

0

Please sign in to leave a comment.