mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-24 23:45:52 +00:00
Added tests for CPFormatter and Foundation import.
This commit is contained in:
1 parent
2a4d3507b8
commit
7696b30067
3 files changed
+46
-1
No files matched your search
@@ -151,7 +151,7 @@
|
||||
- (BOOL)isPartialStringValue:(CPString)aPartialString proposedSelectedRange:(CPRange)aProposedSelectedRange originalString:(CPString)originalString originalSelectedRange:(CPRange)originalSelectedRange errorDescription:(CPString)anError
|
||||
{
|
||||
_CPRaiseInvalidAbstractInvocation(self, @selector(isPartialStringValue:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:));
|
||||
return nil;
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(CPCoder)aCoder
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
@import "CPDictionary.j"
|
||||
@import "CPEnumerator.j"
|
||||
@import "CPException.j"
|
||||
@import "CPFormatter.j"
|
||||
@import "CPIndexSet.j"
|
||||
@import "CPInvocation.j"
|
||||
@import "CPJSONPConnection.j"
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
@import <Foundation/CPFormatter.j>
|
||||
|
||||
@implementation CPFormatterTest : OJTestCase
|
||||
|
||||
- (void)testThatCPFormatterIsConstructed
|
||||
{
|
||||
[self assertNotNull:[[CPFormatter alloc] init]];
|
||||
}
|
||||
|
||||
- (void)testStringForObjectValue
|
||||
{
|
||||
var formatter = [[CPFormatter alloc] init];
|
||||
|
||||
[self assertThrows:function(){ [formatter stringForObjectValue:@"Hello World"]; }];
|
||||
}
|
||||
|
||||
- (void)testEditingStringForObjectValue
|
||||
{
|
||||
var formatter = [[CPFormatter alloc] init];
|
||||
|
||||
[self assertThrows:function(){ [formatter editingStringForObjectValue:@"Hello Wolrd"]; }];
|
||||
}
|
||||
|
||||
- (void)testGetObjectValueForString
|
||||
{
|
||||
var formatter = [[CPFormatter alloc] init];
|
||||
|
||||
[self assertThrows:function(){ [formatter getObjectValue:@"Hello World" forString:@"Hello World" errorDescription:nil]; }];
|
||||
}
|
||||
|
||||
- (void)testIsPartialStringValidNewEditingString
|
||||
{
|
||||
var formatter = [[CPFormatter alloc] init];
|
||||
|
||||
[self assertThrows:function(){ [formatter isPartialStringValid:@"Hello Wolrd" newEditingString:@"Hello World" errorDescription:nil]; }];
|
||||
}
|
||||
|
||||
- (void)testIsPartialStringValueProposedSelectedRange
|
||||
{
|
||||
var formatter = [[CPFormatter alloc] init];
|
||||
|
||||
[self assertThrows:function(){ [formatter isPartialStringValue:@"Hello Wolrd" proposedSelectedRange:CPRangeMake(3,5) originalString:@"Hello World" originalSelectedRange:nil errorDescription:nil]; }];
|
||||
}
|
||||
@end
|
||||
Reference in new issue
Block a user