mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 21:17:03 +00:00
38 lines
568 B
Plaintext
38 lines
568 B
Plaintext
|
|
@import <AppKit/CPButton.j>
|
|
@import <AppKit/CPApplication.j>
|
|
|
|
[CPApplication sharedApplication]
|
|
|
|
@implementation CPButtonTest : OJTestCase
|
|
{
|
|
CPButton button;
|
|
BOOL wasClicked;
|
|
}
|
|
|
|
- (void)setUp
|
|
{
|
|
button = [CPButton buttonWithTitle:"hello world"];
|
|
wasClicked = NO;
|
|
}
|
|
|
|
- (void)testCanCreate
|
|
{
|
|
[self assertTrue:!!button];
|
|
}
|
|
|
|
- (void)testPerformClick
|
|
{
|
|
[button setTarget:self];
|
|
[button setAction:@selector(clickMe:)];
|
|
[button performClick:nil];
|
|
[self assertTrue:wasClicked];
|
|
}
|
|
|
|
- (void)clickMe:(id)sender
|
|
{
|
|
wasClicked = YES;
|
|
}
|
|
|
|
@end
|