Posts

Showing posts from March, 2019

Validate your ArrayAdapter with Espresso test case

Image
This tutorial is based on ArrayAdapter which returns custom object on getItem() function of the adapter. In this demo our custom object is as follows. (Note this things are in Recycler view or ArrayAdapter ) public static class HelloCustomList {         private String label;         private String subLabel;         public HelloCustomList (String label, String subLabel) {             this.label = label;             this.subLabel = subLabel;         }         public String getLabel() {             return label;         }         public void setLabel(String label) {             this.label = label;         }         public String getSubLabel() {             return subLabel;         }         public void setSubLabel(String subLabel) {             this.subLabel = subLabel;         }     } private List<HelloCustomList> mylist; public HelloCustomList getItem(int position) {      //This returns custom object instead of Predefined Type such as int string