I have a couple of questions regarding unit testing in different areas.
1. I'm implementing a custom InlayHintsProvider, and I want to write some tests as well for it. Now, I found examples in intellij-community:
and I see that it is similar to how inspection testing works.
If I'm not mistaken <# [hint text] #> is supposed to validate inline hints while <# block [hint text] #> validates block type ones.
In case of e.g.
<# block [ 2 usages 2 inheritors ] #>
- are whitespaces around hint texts meant to represent the inset and padding around hints,
- and is there anything else that would be useful to know about inlay hint testing, and is there any documentation about it?
2. I'm testing a Configurable object for a Settings panel, which incorporates manipulating an application and a project service. I'm using BasePlatformTestCase as the base class and I have multiple test methods.
The problem I have is that the services are not reset after each test method, and due to this test methods interfere with each other. Is there a way to reset the state of services or even remove service instances between test methods?
I tried running them as JUnit run configuration and via Gradle as well.
I could reset each field in the services manually, but I have some logic to load default data, so that would not entirely solve my problem.
3. In the plugin I'm implementing, I have a project service which I would like to validate with simulating having multiple projects open. Is there a recommended or nice way to have more than one projects open in unit testing or open them programmatically?