android / android/testing-samples

Reduce need to augment production code to make recyclerview more testable

Đang mở
#287 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
9.3k
Fork
3.6k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Is this suggested best practice or can we fix this sample to provide better ways of interacting with RecyclerViews and making assertions on the viewholder?

```
@Override
public void onBindViewHolder(ViewHolder viewHolder, final int position) {
if (position == mDataSet.size() / 2 /* calculate middle element position */) {
viewHolder.setIsInTheMiddle(true);
viewHolder.getTextView().setText(mContext.getResources().getString(R.string.middle));
} else {
viewHolder.setIsInTheMiddle(false);
viewHolder.getTextView().setText(mDataSet.get(position));
}
}
```

From : https://github.com/googlesamples/android-testing/blob/master/ui/espresso/RecyclerViewSample/app/src/androidTest/java/com/example/android/testing/espresso/RecyclerViewSample/RecyclerViewSampleTest.java

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start with RecyclerViewSampleTest.java in the linked androidTest sample and review the onBindViewHolder implementation shown in the issue. Determine whether the sample can expose better RecyclerView interactions and ViewHolder assertions without augmenting production code; done means the tests demonstrate that approach clearly.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
android, java
Lĩnh vực
mobile, testing
Loại issue
Tái cấu trúc
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.