I have a class
class SearchCriteria
{
someEnum with values like "A","B"
int id;
}
I want to mock a Delgeate with one method as
class Delegate
{
int getSomeStuff(SearchCriteria search)
{
//call dao and return count
}
}
How do I pass SearchCriteria using Mock
Delegate mock;
when(mock.getSomeStuff(??))thenReturn(5);
Here for different Use cases of SearchCriteria , I want different values to be returned
So if enum in SearchCriteria is set to A thenReturn 0 and in B then return 1 ...etc
How do I achieve this ?