mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-10 18:52:19 +00:00
First unit test for CPString for method boolValue
This commit is contained in:
1 parent
ec6c08e9ea
commit
33c0dcd482
1 file changed
+42
@@ -0,0 +1,42 @@
|
||||
import <Foundation/CPString.j>
|
||||
|
||||
@implementation CPStringTest : OJTestCase
|
||||
|
||||
- (void) testBoolValue
|
||||
{
|
||||
var testString = @" 090";
|
||||
[self assertTrue:[testString boolValue] message:"boolValue for the string " + testString + " should return true"];
|
||||
|
||||
testString = @" YES";
|
||||
[self assertTrue:[testString boolValue] message:"boolValue for the string " + testString + " should return true"];
|
||||
|
||||
testString = @" true";
|
||||
[self assertTrue:[testString boolValue] message:"boolValue for the string " + testString + " should return true"];
|
||||
|
||||
testString = @" True";
|
||||
[self assertTrue:[testString boolValue] message:"boolValue for the string " + testString + " should return true"];
|
||||
|
||||
testString = @" tTR";
|
||||
[self assertTrue:[testString boolValue] message:"boolValue for the string " + testString + " should return true"];
|
||||
|
||||
testString = @" +98";
|
||||
[self assertTrue:[testString boolValue] message:"boolValue for the string " + testString + " should return true"];
|
||||
|
||||
testString = @" -98";
|
||||
[self assertTrue:[testString boolValue] message:"boolValue for the string " + testString + " should return true"];
|
||||
|
||||
testString = @" +08";
|
||||
[self assertTrue:[testString boolValue] message:"boolValue for the string " + testString + " should return true"];
|
||||
|
||||
testString = @" -98";
|
||||
[self assertTrue:[testString boolValue] message:"boolValue for the string " + testString + " should return true"];
|
||||
|
||||
testString = @" NO";
|
||||
[self assertFalse:[testString boolValue] message:"boolValue for the string " + testString + " should return true"];
|
||||
|
||||
testString = @" -N00";
|
||||
[self assertFalse:[testString boolValue] message:"boolValue for the string " + testString + " should return true"];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user