lundi 23 février 2015

Need to verify size of an array in unit testing


Class Test {
private ArrayList<someType> arr = new ArrayList<>();
public someType bestelement() {
return arr.get(0);
arr.remove(0);
}


I have written test case for this method and it's running successfully but I need to know how can I be sure that the remove() method was called and the size of array list was reduced by 1? Please do tell me how to get the size of arr in my test case?


Aucun commentaire:

Enregistrer un commentaire