mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-12-02 19:22:58 +00:00
Add a couple tests for bugs reported from Pivotal. They aren't ideal, though, because of the CPApp issue.
This commit is contained in:
1 parent
e32963384e
commit
df20a6d6df
2 files changed
+43
-2
No files matched your search
@@ -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
|
||||
@@ -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
|
||||
Reference in new issue
Block a user