java - Create unit tests in android studio -


i'm following this tutorial.
want create unit tests androidjunitrunner.

my directory in app/src looks this:

androidtest debug main release 

android docs suggests create test/java unit tests.
problem in android studio can't create new directory if i'm on android project mode. , should find directory manually , create manually.
there way automatically create these directories , tests 1 flavor?
i've read this question, doesn't relate problem.

it's easiest create folder manually in directory. android studio notice pretty , show in android view.

you need create packages in test/java folder too. if package name com.foo.bar need create following dir structure in app/src folder:

test/java/com/foo/bar

as aside in latest versions of android studio don't need use androidjunitrunner anymore. studio supports junit4 tests out of box.

to make tests particular flavor need append flavor name end of test folder. if flavor dev folder structure be:

testdev/java/com/foo/bar


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -