Skip to content

Instantly share code, notes, and snippets.

@andrewsardone
Created February 28, 2012 20:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewsardone/1935008 to your computer and use it in GitHub Desktop.
Save andrewsardone/1935008 to your computer and use it in GitHub Desktop.
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