dimanche 10 juillet 2016

Android Studio 2.1.2 Local Unit Test steps

When attempting to run a 'hello world' type 'local unit test' i get the error

Test running failed: Instrumentation run failed due to 'java.lang.RuntimeException'

Looking at documentation at http://ift.tt/1CABuw1 i have verified the following is in the app/build.gradle

testCompile 'junit:junit:4.12'

I would like concise steps on how to setup 'local unit testing' from 'File>New>New Project' with an empty activity.

Testing the method addition_isCorrect or whole class .ExampleUnitTest

Additionally my setup starts an emulated device but I understand that local unit testing did not need a device or emulator?

Also it appears that the Test Artifact in the Build Variants view. is obsolete now.

Aucun commentaire:

Enregistrer un commentaire