OCMockito check with any arguments

I am trying to verify that a function on a mock object is NOT called at all with ANY parameters.

Function on the object that I am mocking ...

- (void)registerUserWithUsername:(NSString*)username password:(NSString*)password; 

I want to check that the function is NOT called if the username is empty.

i.e.

 [mockService registerUserWithUsername:@"" password:@"Password"]; [verify(mockService, never()) registerWithUsername:....... password:.......]; 

I'm just not sure what to add ...... a bit?

+4
source share
1 answer

To indicate that it never called any parameters, use anything() :

 [verify(mockService, never()) registerWithUsername:(id)anything() password:(id)anything()]; 
+11
source

All Articles