I'm trying to mock the CLBeacon object inorder to test the app behavior for a particular type of beacon. But I'm facing trouble to stub the method proximity to return a required proximity value from it.
Below is the code which has the issue:
id clBeacon = [OCMockObject niceMockForClass:[CLBeacon class]];
[[[clBeacon stub] andReturn:@"2"] major];
[[[clBeacon stub] andReturn:@"0"] minor];
[[[clBeacon stub] andReturnValue: OCMOCK_VALUE(CLProximityNear)] proximity]; // Didn't work
[[[clBeacon stub] andReturn: @""] proximity]; // Didn't work
The above code raising the below issue when I'm trying to stub the proximity response.
Multiple methods named 'proximity' found with mismatched result, parameter or attributes
Can someone point me the exact issue with the above code??
Regards.