我正在尝试注入我的应用组件like this 因为我使用这个样板。
##Get all the words in List
read_words = open('mm-words.txt','r')
##Achieve them in List
li_words = read_words.read().split('\n')
##Now run into function
print analyze(li_a, li_words)
这位于新的测试文件夹中:
private void setupDaggerTestComponentInApplication() {
WSApplication application = WSApplication.get(mContext);
mTestComponent = DaggerTestComponent.builder()
.applicationTestModule(new ApplicationTestModule(application))
.build();
application.setComponent(mTestComponent);
}
输出:
sourceSets {
def commonTestDir = 'src/commonTest/java'
test {
java.srcDir commonTestDir
}
androidTest {
java.srcDir commonTestDir
}
}
DAGGER_VERSION = '2.11-rc2'
有什么想法吗?感谢