This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class NumberPickerWrapper { | |
static public NumberPickerWrapper createHolder(View view) { | |
NumberPickerWrapper numberPickerWrapper; | |
numberPickerWrapper = Build.VERSION.SDK_INT > 10 ? new NumberPickerWrapper_Sdk14() | |
: new NumberPickerWrapper_Sdk10(); | |
numberPickerWrapper.setView(view); | |
return numberPickerWrapper; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
platform :ios | |
# Add logging framework to all targets. | |
pod 'CocoaLumberjack' | |
# Add Kiwi to unit test target only. | |
target :UnitTests, :exclusive => true do | |
pod 'Kiwi' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation HelloTDDTestController | |
- (void)initializeScenarios { | |
[self addScenario:[KIFTestScenario scenarioToDisplayGreeting]]; | |
} | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation HelloTDDViewControllerTests { | |
HelloTDDViewController *viewController; | |
} | |
- (void)setUp { | |
viewController = [[HelloTDDViewController alloc] init]; | |
} | |
//... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface HelloTDDViewController : UIViewController | |
@property(strong, nonatomic) id<HelloTDDViewControllerDelegate> delegate; | |
@property(weak, nonatomic) IBOutlet UITextField *nameField; | |
@property(weak, nonatomic) IBOutlet UILabel *helloLabel; | |
- (IBAction)onButtonClick:(id)sender; | |
- (void)showGreeting:(NSString *)message; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation KIFTestScenario (HelloTDDAdditions) | |
+ (id)scenarioToDisplayGreeting { | |
KIFTestScenario *scenario = | |
[KIFTestScenario scenarioWithDescription: | |
@"Test greeting with name."]; | |
[scenario addStep: | |
[KIFTestStep stepToEnterText: | |
@"Chuck Norris"intoViewWithAccessibilityLabel:@"Name"]]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation HelloTDDViewController | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
GreetingFactory *greetingFactory = [[GreetingFactory alloc] init]; | |
_delegate = greetingFactory; | |
} | |
//... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation HelloTDDViewController | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
_nameField.accessibilityLabel = @"Name"; | |
_helloLabel.accessibilityLabel = @"Greeting"; | |
GreetingFactory *greetingFactory = [[GreetingFactory alloc] init]; | |
_delegate = greetingFactory; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SPEC_BEGIN(HelloTDDViewControllerSpec) | |
describe(@"HelloTDDViewController", ^{ | |
HelloTDDViewController *viewController = | |
[[HelloTDDViewController alloc] init]; | |
MockHelloTDDViewControllerDelegate *delegate = | |
[[MockHelloTDDViewControllerDelegate alloc] init]; | |
//... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation KIFTestStep (HelloTDDAdditions) | |
+ (id)stepToVerifyGreeting:(NSString *)expectedLabel { | |
NSString *description = | |
[NSString stringWithFormat:@"Verify output is '%@'", | |
expectedLabel]; | |
return [self stepWithDescription:description | |
executionBlock:^(KIFTestStep *step, NSError **error) { |