Add a couple tests for bugs reported from Pivotal. They aren't ideal, though, because of the CPApp issue.

This commit is contained in:
Ross Boucher committed 2010-02-23 11:07:53 -08:00
1 parent e32963384e
commit df20a6d6df
2 files changed
+43 -2

No files matched your search

+24 -2
View File
@@ -1,15 +1,37 @@
@import <AppKit/CPButton.j>
@import <AppKit/CPStringDrawing.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
{
var button = [CPButton buttonWithTitle:"hello world"];
[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
+19
View File
@@ -0,0 +1,19 @@
@import <AppKit/CPWindow.j>
[CPApplication sharedApplication]
@implementation CPWindowTest : OJTestCase
{
CPWindow theWindow;
}
-(void)testCanAllocWindow
{
theWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(0,0,200,150)
styleMask:CPWindowNotSizable];
[self assertTrue:!!theWindow];
}
@end