Android Studio Unit Test

Source: Internet
Author: User

Just started to try the Water Android Studio tool for Android development exploration, today mainly explains the use of Android Studio Tools, the new Android project will bring your own

This part of the content, later found to be unit testing, so I began to explore it.

I.description of Applicationtest

applicationtest is inherited applicationtestcase the class, which is Android-sdk-windows class (the system comes with).

Applicationtestcase is primarily used to test the application class, providing basic support for the application class life cycle approach.

Second, in Applicationtest fill in the test code, as below,

1      Public void throws Exception {2          int input1 = 1; 3          int input2 = 2; 4         assertequals (INPUT1, input2); 5     }


Third, right-click the test method, will pop up

Select-run and the following results will appear:

Summary: So far, a simple unit test is complete.

Android Studio Unit Test

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.