Created
May 17, 2016 05:51
-
-
Save takaiwa/a9dbf22d8789fc5fb7e31431ffa74836 to your computer and use it in GitHub Desktop.
RecyclerViewのリストの並びテストの補足用
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Item { | |
String displayName; | |
public Item(String displayName) { | |
this.displayName = displayName; | |
} | |
public String getDisplayName() { | |
return displayName; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<Item> items = new ArrayList<>(); | |
items.add(new Item("foo")); | |
items.add(new Item("bar")); | |
items.add(new Item("hogehoge")); | |
RecyclerViewInteraction.<Item>onRecyclerView(withId(R.id.recyclerView)) | |
.withItems(items) | |
.check(new RecyclerViewInteraction.ItemViewAssertion<Item>() { | |
@Override | |
public void check(Item item, View view, NoMatchingViewException e) { | |
matches(hasDescendant(withText(item.getDisplayName()))) | |
.check(view, e); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment