Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
I'm finally making two-stage object creation work for me ;-)
#import <SenTestingKit/SenTestingKit.h>
#import "OCMock.h"
#import "NLPageControlScrollViewHelper.h"
#pragma mark - Tests
@interface NLPageControlScrollViewHelperTests : SenTestCase
@end
@implementation NLPageControlScrollViewHelperTests
- (void)testSetSelfAsScrollViewDelegate
{
id mockScrollView = [OCMockObject niceMockForClass:[UIScrollView class]];
// alloc
NLPageControlScrollViewHelper *helper = [NLPageControlScrollViewHelper alloc];
[[mockScrollView expect] setDelegate:helper];
// then init
helper = [helper initWithPageControl:nil scrollView:mockScrollView];
[mockScrollView verify];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.