This repository has been archived by the owner on Feb 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 574
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documented NSData category. Documented UIView category. Added UIView …
…category test. Removed old, messy UIView categories. Use new block API for UIView category animations. #24
- Loading branch information
Showing
5 changed files
with
165 additions
and
55 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// | ||
// ViewTest.m | ||
// SSToolkit | ||
// | ||
// Created by Sam Soffes on 7/10/11. | ||
// Copyright 2011 Sam Soffes. All rights reserved. | ||
// | ||
|
||
#import <SSToolkit/UIView+SSToolkitAdditions.h> | ||
#import <SSToolkit/SSLineView.h> | ||
|
||
@interface ViewCategoryTest : GHTestCase | ||
@end | ||
|
||
@implementation ViewCategoryTest | ||
|
||
- (void)testHide { | ||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero]; | ||
[view hide]; | ||
GHAssertEquals(view.alpha, 0.0f, nil); | ||
[view release]; | ||
} | ||
|
||
|
||
- (void)testShow { | ||
UIView *view = [[UIView alloc] initWithFrame:CGRectZero]; | ||
view.alpha = 0.0f; | ||
[view show]; | ||
GHAssertEquals(view.alpha, 1.0f, nil); | ||
[view release]; | ||
} | ||
|
||
|
||
- (void)testSuperviews { | ||
UIView *one = [[UIView alloc] initWithFrame:CGRectZero]; | ||
UIView *two = [[UIView alloc] initWithFrame:CGRectZero]; | ||
UIView *three = [[UIView alloc] initWithFrame:CGRectZero]; | ||
UIView *four = [[UIView alloc] initWithFrame:CGRectZero]; | ||
UIView *five = [[UIView alloc] initWithFrame:CGRectZero]; | ||
|
||
[four addSubview:five]; | ||
[three addSubview:four]; | ||
[two addSubview:three]; | ||
[one addSubview:two]; | ||
|
||
NSArray *superviews = [[NSArray alloc] initWithObjects:four, three, two, one, nil]; | ||
|
||
GHAssertEqualObjects([five superviews], superviews, nil); | ||
|
||
[superviews release]; | ||
[one release]; | ||
[two release]; | ||
[three release]; | ||
[four release]; | ||
[five release]; | ||
} | ||
|
||
|
||
- (void)testFirstSuperviewOfClass { | ||
UIView *one = [[SSLineView alloc] initWithFrame:CGRectZero]; | ||
UIView *two = [[SSLineView alloc] initWithFrame:CGRectZero]; | ||
UIView *three = [[UIView alloc] initWithFrame:CGRectZero]; | ||
UIView *four = [[UIView alloc] initWithFrame:CGRectZero]; | ||
UIView *five = [[UIView alloc] initWithFrame:CGRectZero]; | ||
|
||
[four addSubview:five]; | ||
[three addSubview:four]; | ||
[two addSubview:three]; | ||
[one addSubview:two]; | ||
|
||
GHAssertEqualObjects([five firstSuperviewOfClass:[SSLineView class]], two, nil); | ||
|
||
[one release]; | ||
[two release]; | ||
[three release]; | ||
[four release]; | ||
[five release]; | ||
} | ||
|
||
@end |