????III. ???????
????1. AssertJ Android
????square/assertj-android
?????????????????
????// ????JUnit
????assertEquals(View.GONE?? view.getVisibility());
????// AssertJ Android
????assertThat(view).isGone();
????2. Robolectric
????Robolectric
?????????????????????????????????????Android?????
??????????????????к???????????????????????????Android?????????????Android??????????豸???棬??????????????????????????????????????????????????????????????????????????????: Pivotal?????????? Robolectric ????????Robolectrict???Android???????? Shadow Classes ???????????????д??????????д??????????????????????????????JVM?????????
????3. Mockito
????Mockito
????????????????????????????
?????????Roblectric??Mockito???????????????????Щ???????????
????// ???????????? myQueryObject.getCurrentTime????????????? 1363027600
????Mockito.doReturn((long) 1363027600).when(myQueryObject).getCurrentTime();
????4. Robotium
????RobotiumTech/robotium
????(Integration Tests)??????????????????????
???????????????????????????????в?????????????????????????????????豸???????е?????Щ??????????????????????????????
????Building Local Unit Tests
????Testing the Android way
????timber?е??????????
????timber/build.gradle
????A BDD (RSpec-like) testing library for Java
????© 2012 - 2016?? Jacksgong(blog.dreamtobe.cn). Licensed under the Creative Commons Attribution-NonCommercial 3.0 license (This license lets others remix?? tweak?? and build upon a work non-commercially?? and although their new works must also acknowledge the original author and be non-commercial?? they don’t have to license their derivative works on the same terms). http://creativecommons.org/licenses/by-nc/3.0/