Skip to content

Instantly share code, notes, and snippets.

@ydzheng
Last active August 29, 2015 14:06
Show Gist options
  • Save ydzheng/5cc381a733c27dca26bc to your computer and use it in GitHub Desktop.
Save ydzheng/5cc381a733c27dca26bc to your computer and use it in GitHub Desktop.
- (void)testSubviews {
WFPinView *v = [[WFPinView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 568.0f)];
[v layoutSubviews];
CGRect expectedRect = CGRectMake((25.0f, 0.0f, 271.0f, 568.0f));
XCTAssertTrue(CGRectEqualToRect(expectedRect, v.phoneBg.frame), @"Wrong phoneBg frame");
XCTAssertTrue(v.phoneBg.superview == v, @"Wrong superview");
XCTAssertTrue([v.setPinButton isKindOfClass:[UIButton class]], @"Wrong class");
expectedRect = CGRectMake(261.0f, 217.0f, 47.0f, 47.0f);
XCTAssertTrue(CGRectEqualToRect (expectedRect, (, v.setPinButton.frame);
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment