Autogenerate unit test stubs on android studio

I am creating a unit test for some legacy Android codes.

Currently, I need to manually create a unit test for each class / method in test / java.

Is there an automatic way to automatically create all test stubs? Ideally from the Android IDE studio? (similar to how parasoft can auto-generate empty test stubs for C ++ classes and methods).

I use robolectric on android studio 1.2.1

+6
source share
1 answer

Like this: right-click the class name. Go To -> Test . Select the Done feature.

enter image description here

+1
source

Source: https://habr.com/ru/post/986795/


All Articles