简体   繁体   中英

How to do Unit testing in Android Studio?

I am a Beginner in Android. I want to write a unit testing code in Android studio. How to run that testing in real device and also how to get the test result. I can able to see AndroidTest folder in src folder.

It is a good practice to write Unit Test code from scratch. But if you have learned a little bit of Unit testing basic you can take advantage of IntelliJ plugins for Android Studio to generate Unit Testing code very easily.

Try this: TestMe ( https://plugins.jetbrains.com/plugin/9471-testme )

Auto Generate Unit Tests for source class in Java or Groovy. No more boilerplate!

Features:

  • Auto-generate Java or Groovy test code with JUnit 4/5, TestNG or Spock frameworks
  • Auto-generate Mockito mocks
  • Generate test params and assertion statements

Quick-Start: http://weirddev.com/testme/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM