Test ArrayAdapter in Android -
i'm trying test custom arrayadapter , i'm having issues getting list appear
public class planofcarecheckboxadaptertest extends androidtestcase { planofcarecheckboxadapter madapter; list<string> values; context mcontext; public planofcarecheckboxadaptertest() { super(); } @before public void setup() throws exception { super.setup(); mcontext = new mockcontext(); new pocvalues(mcontext); values = arrays.aslist("one", "two", "three"); madapter = new planofcarecheckboxadapter(mcontext, r.layout.item_multi_check, values, pocvalues.mastermap); assertequals("two", madapter.getitem(0)); }
my implementation:
public class planofcarecheckboxadapter extends arrayadapter<string>{ private bimap<integer, string> map; private set<integer> mpendingitems, mdoneitems; private boolean issuperuser; public planofcarecheckboxadapter(context context, int resource, list objects, bimap<integer, string> mapping) { super(context, resource, objects); issuperuser = false; mpendingitems = new hashset<>(); mdoneitems = new hashset<>(); map = mapping; }
when run test actual result of null? why?
Comments
Post a Comment