Has anyone managed to make a reasonably comfortable setup for their project where unit tests run on every save?
I currently have a split project -- An Android Application project, and a Java project that the android application depends upon. I write unit tests for the Java project and run them manually every now and then.
In my understanding, to make this happen as expected, I also want to have incremental builds for the Java project. I am not sure that this is feasibly possible while using Gradle with its current state of affairs.
To generate unit tests, your types must be public. Open your solution in Visual Studio and then open the class file that has methods you want to test. Right-click on a method and choose Run IntelliTest to generate unit tests for the code in your method. IntelliTest runs your code many times with different inputs.
To run all the tests in a default group, choose the Run icon and then choose the group on the menu. Select the individual tests that you want to run, open the right-click menu for a selected test and then choose Run Selected Tests (or press Ctrl + R, T).
By default, the source files for local unit tests are placed in module-name/src/test/ . This directory already exists when you create a new project using Android Studio.
If you are using Eclipse or IntelliJ with JUnit, you can use InfiniTest to run tests on save. InfiniTest only runs tests for code that has changed rather than running everything, so it's great for TDD. InfiniTest is completely decoupled from Gradle, so you don't have to worry about incremental builds.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With