美文网首页
android 单元测试

android 单元测试

作者: javaBoy_hw | 来源:发表于2018-01-04 16:34 被阅读0次

简介

常用依赖

// Unit test compile

testImplementation 'junit:junit:4.12'

testCompile'com.squareup.okhttp3:mockwebserver:3.8.0'

testCompile"org.robolectric:robolectric:3.3.2"

testCompile"org.robolectric:shadows-httpclient:3.3.2"

testCompile"org.robolectric:shadows-support-v4:3.3.2"

testImplementation'org.mockito:mockito-core:2.11.0'

testCompile'com.google.code.gson:gson:2.7'

//android instrumental test compile

androidTestCompile'junit:junit:4.12'

androidTestCompile'org.mockito:mockito-core:2.11.0'

androidTestCompile'com.google.dexmaker:dexmaker:1.2'

androidTestCompile'com.google.dexmaker:dexmaker-mockito:1.2'

Mockito

入门

1. 导入依赖;

2. 在androidTest中创建测试类,导包;

相关文章

网友评论

      本文标题:android 单元测试

      本文链接:https://www.haomeiwen.com/subject/axnrnxtx.html