-
-
Save bvanderveen/3260382 to your computer and use it in GitHub Desktop.
Objective-C assertion ideas
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
- (void) assertionIdeasLikeNUnit | |
{ | |
[Assert that:@"foobar" is:[Equal to:@"other"]]; | |
[Assert that:@"foobar" isNot:[Equal to:@"other"]]; | |
[Assert that:collection isAll:[Less than:@10]]; | |
[Assert that:collection isAll:[Less thanOrEqualTo:@10]]; | |
[Assert that:collection isAll:[Less thanOrEqualTo:@10]]; | |
[Assert that:collection isAll:[Greater than:@10]]; | |
[Assert that:collection isAll:[Greater thanOrEqualTo:@10]]; | |
[Assert that:collection isAll:[Greater thanOrEqualTo:@10]]; | |
[Assert that:value is:[Less thanInteger:10]]; | |
[Assert that:value is:[Less thanFloat:10f]]; | |
[Assert that:value is:[Between low:@0 high:@10]]; | |
[Assert that:value is:[Between low:lo high:hi using:comparer]]; | |
[Assert that:nil is:[Equal toNil]]; | |
[Assert that:bool is:[Equal toNO]]; | |
[Assert that:bool is:[Equal toYES]]; | |
[Assert that:pointer1 is:[Same as:pointer2]]; | |
[Assert that:object is:[Kind of:[Foo class]]]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment