Running simple JUnit tests on Android Studio (IntelliJ) when using a Gradle-based configuration

前端 未结 6 1810
死守一世寂寞
死守一世寂寞 2020-12-12 12:39

I am using Android Studio/IntelliJ to build on an existing Android project and would like to add some simple JUnit unit tests. What is

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-12 13:21

    Please see this tutorial from the Android Developers official site. This article also shows how to create mock-ups for your testing.

    By the way, you should note that the scope of the dependencies for simple JUnit test should be "testCompile".

提交回复
热议问题