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