Tests: new nil exception test for CPDictionary.

This commit is contained in:
Alexander Ljungberg
2015-03-29 13:16:51 +01:00
parent c7770c37d0
commit d39bcfb7bd
+8 -1
View File
@@ -419,7 +419,7 @@
- (void)testInitWithObjectsAndKeys
{
var dict = [[CPDictionary alloc] initWithObjectsAndKeys:@"Value1", @"Key1", nil, @"Key2", @"Value3", @"Key3"];
var dict = [[CPDictionary alloc] initWithObjectsAndKeys:@"Value1", @"Key1", @"Value3", @"Key3"];
[self assert:2 equals:[dict count]];
[self assert:@"Value1" equals:[dict objectForKey:@"Key1"]];
@@ -427,6 +427,13 @@
[self assert:@"Value3" equals:[dict objectForKey:@"Key3"]];
}
- (void)testInitWithObjectsAndKeysAndNilValueShouldThrowException
{
[self assertThrows:function () {
[[CPDictionary alloc] initWithObjectsAndKeys:@"Value1", @"Key1", nil, @"Key2", @"Value3", @"Key3"]
}];
}
- (void)testDictionaryLiteral
{
var dict = @{