From 33c0dcd48212f97fb31da11bbb9dabaeee582706 Mon Sep 17 00:00:00 2001 From: vijaykiran Date: Tue, 16 Sep 2008 18:59:07 +0200 Subject: [PATCH] First unit test for CPString for method boolValue --- Tests/Foundation/CPStringTest.j | 42 +++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Tests/Foundation/CPStringTest.j diff --git a/Tests/Foundation/CPStringTest.j b/Tests/Foundation/CPStringTest.j new file mode 100644 index 000000000..d62682894 --- /dev/null +++ b/Tests/Foundation/CPStringTest.j @@ -0,0 +1,42 @@ +import + +@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