TeodorKolev TeodorKolev - 14 days ago 4
Java Question

Android Studio add tests for newly added methods

My target is to add tests for newly added methods in Android Studio. For example I have class with three methods that already has tests. I add new two methods. How can Android studio generate (add) test only for newly added tests?

Answer
  • Put your cursor on any public mehtod's name inside that class.
  • See the yellow bulb on the left hand side and open the bulb options.
  • Select Generate missed test methods.

enter image description here

  • You can see the list of uncovered public methods and you can go forward and auto-generate your unit test templates for each of them. :))

enter image description here