如何在espresso中使用AdapterViewProtocol? [英] How to use AdapterViewProtocol in espresso?
问题描述
我使用Espresso 2.0库测试Android项目,并且需要使用方法onData
,但是我具有自定义的ProductsAdapter,因此必须实现AdapterViewProtocol(android.support.test.espresso.action.AdapterViewProtocol
),
I use Espresso 2.0 library to test an Android project, and I need to use method onData
, but I have custom ProductsAdapter, so I must implement AdapterViewProtocol (android.support.test.espresso.action.AdapterViewProtocol
),
我需要找到一个为onData
方法实现AdapterViewProtocol的工作示例.
I need to find a working example implementing AdapterViewProtocol for onData
method.
我只找到了这个: https://gist.github.com/brennantaylor/9379399.但我想要小型且有效的项目.请帮帮我.
I have only found this: https://gist.github.com/brennantaylor/9379399. But I want small and working project. Help me, please.
推荐答案
您可以尝试使用CursorAdapter查看此示例: https://gist.github.com/brennantaylor/9379399 .
You can try to look at this example with CursorAdapter: https://gist.github.com/brennantaylor/9379399 .
Or in standard Espresso implementation: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.0.0_r1/com/google/android/apps/common/testing/ui/espresso/action/AdapterViewProtocols.java#AdapterViewProtocols.StandardAdapterViewProtocol
这篇关于如何在espresso中使用AdapterViewProtocol?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!