如何使用androidX.test使用robolectric“ shadow”

时间:2018-12-12 18:44:18

标签: junit4 robolectric androidx

有人可以帮助我如何在带有androidX.test的android单元测试中使用robolectric“ shadow”

我的gradle文件配置

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
    implementation 'com.google.android.material:material:1.1.0-alpha01'
    testImplementation 'junit:junit:4.12'
    // Core library
    androidTestImplementation 'androidx.test:core:1.0.0'

    // AndroidJUnitRunner and JUnit Rules
    androidTestImplementation 'androidx.test:runner:1.1.0'
    androidTestImplementation 'androidx.test:rules:1.1.0'

    // Assertions
    androidTestImplementation 'androidx.test.ext:junit:1.0.0'
    androidTestImplementation 'androidx.test.ext:truth:1.0.0'
    androidTestImplementation 'com.google.truth:truth:0.42'
}

0 个答案:

没有答案