How to use OCMock to return different result base on different argument -
i trying mock different method return when passing different argument same method. self.mymock = [ocmockobject mockforclass:[myclass class]]; [[[self.mymock expect] andreturnvalue:5] mystaticmethod:3]; [[[self.mymock expect] andreturnvalue:10] mystaticmethod:6]; but takes first one, when argument 3 return 5, , when argument 6, return nil instead of 10. know whether way test this? the real code: -(nsmutablearray*)convertchildstringtochilddic:(nsstring*)strchildren { nsarray *kididarray = [strchildren componentsseparatedbystring:@","]; //处理小孩信息 /*children = ( { avatarsmall = "<null>"; currentstatus = 0; displayname = stu1; "id_str" = "70938032-3811-e411-946a-005056c00008"; title = child; } )*/ nsmutablearray *rstchildarray = [nsmutablearray arraywithcapacity:1]; (nsstring *enrollment_id in kididarray) { if (enrollment_id.length <= 0) { ...