Skip to content

Instantly share code, notes, and snippets.

@ydzheng
Last active Aug 29, 2015
Embed
What would you like to do?
- (void)testSetPinButton {
NSArray *actions = [vc.pinView.setPinButton actionsForTarget:vc
forControlEvent:UIControlEventTouchUpInside];
XCTAssertTrue(actions.count == 1, @"Should only be one: %@", actions);
NSString *selectorName = [actions lastObject];
XCTAssertTrue([selectorName isEqualToString:@"setPinTapped:"], @"Wrong selector name");
id partialMockVC = [OCMockObject partialMockForObject:vc];
[[partialMockVC expect] setPinTapped:vc.pinView.setPinButton];
[vc.pinView.setPinButton sendActionsForControlEvents:UIControlEventTouchUpInside];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment