lunes, 13 de abril de 2015

Android Studio: Unit testing

Step 0












Step 1

Right click in the "src" folder and add an "androidTest" folder inside this folder add a "java" folder. Inside the latter you can add your test classes.

Step 2: build.gradle (<your_project>)

Add the following line
dependencies {

 ...
 testCompile 'junit:junit:4.12'
}

Step 3: build.gradle (outter most)

buildscript {
    
 ...

     dependencies {
         classpath 'com.android.tools.build:gradle:1.1.3'
     }
}

Step 4

In the bottom left side of Andriod Studio you will see a "Build Variants tab" click on in and in the drop down menu "Test Artifact" select "Android Instrumentation Tests"

No hay comentarios:

Publicar un comentario