如何在espresso中使用AdapterViewProtocol? [英] How to use AdapterViewProtocol in espresso?

查看:77
本文介绍了如何在espresso中使用AdapterViewProtocol?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用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 .

或在标准Espresso实施中:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆