???????????????????????????????????????????????????????????????淶?? ?? RSpec-style??
????????????????????(If/ese??for??do/while??switch/case)???????????????У???????????Щ????????????????????????
???????????????????????????????????????????????????????(?????????????????????)??
????????????Android Studio????????????
???????????????? private ????????? private ??????????????????????????????? public ???????ɡ?
?????????????????????????????????????Test A??Test B???????????????
????II. Android???????????????
????control + shift + R (Android Studio ?????е?????????)??
????1. ??????????
????????????????????????в????????????????????????????Android????????????£????????????????????
????????洢
????????????????flavor??????build type???????test????????????(??????? myFlavor ?????????????÷??? src/testMyFlavor/java ????)??
????src/test/java
???????????
?????????????????????????????????? @Test ??annotation??
????Google??????????
????dependencies {
????// Required -- JUnit 4 framework?????????????google??????
????testCompile 'junit:junit:4.12'
????// Optional -- Mockito framework?????????????google??????
????testCompile 'org.mockito:mockito-core:1.10.19'
????}
????2. ??????
??????????Android?豸???????????????
??????????????: ???(Android?????????????????)??UI???????????????(Service??Content Provider??etc.)
????????洢:
????src/androidTest/java
????Google??????????
????dependencies {
????androidTestCompile 'com.android.support:support-annotations:23.0.1'
????androidTestCompile 'com.android.support.test:runner:0.4.1'
????androidTestCompile 'com.android.support.test:rules:0.4.1'
????// Optional -- Hamcrest library
????androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
????// Optional -- UI testing with Espresso
????androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
????// Optional -- UI testing with UI Automator
????androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
????}
??????????UI????
??????????Android??????
???????????:
????UI????ú????????????????
??????????????????UI?????????????
?????????????湩?????????