Skip to content

Commit

Permalink
First unit test for CPString for method boolValue
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaykiran committed Sep 16, 2008
1 parent ec6c08e commit 33c0dcd
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions Tests/Foundation/CPStringTest.j
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 33c0dcd

Please sign in to comment.