Skip to content

Instantly share code, notes, and snippets.

@ydzheng
Last active August 29, 2015 14:06
Show Gist options
  • Save ydzheng/e1903f90c8da0f478b16 to your computer and use it in GitHub Desktop.
Save ydzheng/e1903f90c8da0f478b16 to your computer and use it in GitHub Desktop.
- (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