UnitTests/TestDictionaryAdditions.m
author Matthew Kotila
Mon, 14 Dec 2015 00:37:29 -0800
changeset 5949 334dc418b409
parent 3679 f4294bb53b0f
permissions -rw-r--r--
Transition Adium from SenTestingKit to XCTest.

In order to build on OS X 10.11, Xcode 7.2, several changes have been made that are outlined:
- Unit tests Target Build Settings modified:
* 'Wrapper Extension' set to 'xctest'
* 'Enable Modules (C and Objective-C)' set to 'Yes'
- UnitTests Target of AutoHyperlink.framework Build Settings modified:
* 'Wrapper Extension' set to 'xctest'
* 'Enable Modules (C and Objective-C)' set to 'Yes'
* 'Other Linker Flags' removed '-framework SenTestingKit'
- 'SenTestingKit.framework' removed from Adium -> Linked Frameworks -> System
- 'SenTestingKit.framework' removed from Adium -> Linked Frameworks -> AutoHyperlinks.framework.xcodeproj -> External Frameworks and Libraries -> Linked Frameworks
- Find and Replace within 'Adium/Unit tests' && 'Adium/Linked Frameworks/Others/AutoHyperlinks.framework.xcodeproj/UnitTests'
* '<SenTestingKit/SenTestingKit.h>' to '<XCTest/XCTest.h>'
* 'SenTestCase' to 'XCTestCase'
* 'STAssert' to 'XCTAssert'
* 'XCTAssertEquals(' to 'XCTAssertEqual('
* regex '(\[\[\[)([^\]]*\][^\]]*\])(\ autorelease\]);' to '[[$2;'
* regex '(\[)([^\]]*\][^\]]*)(\ autorelease\])' to '$2'
- modified AutoHyperlinks.framework.xcodeproj -> project.pbxproj
* line 331: ?productType = "com.apple.product-type.bundle.ocunit-test";' to 'productType = "com.apple.product-type.bundle.unit-test";'
- AIWebKitMessageViewController.h
* forward declare WebUIDelegate, WebFrameLoadDelegate protocols
* add WebUIDelegate, WebFrameLoadDelegate protocols to 'AIWebKitMessageViewController' class
- AIFacebookXMPPOAuthWebViewWindowController.m lines 107 && 108
* '[[domDoc getElementById:@"email"] setValue:self.autoFillUsername];' to '[domDoc getElementById:@"email"].innerHTML = self.autoFillUsername;'
* '[[domDoc getElementById:@"pass"] setValue:self.autoFillPassword];' to '[domDoc getElementById:@"pass"].innerHTML = self.autoFillPassword;'
- XCTAssertEqual for NSRanges modified to ?XCTAssertTrue(NSEqualRanges(range1, range2)), ...)' in Unit tests
3679
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 2677
diff changeset
     1
/* 
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 2677
diff changeset
     2
 * Adium is the legal property of its developers, whose names are listed in the copyright file included
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 2677
diff changeset
     3
 * with this source distribution.
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 2677
diff changeset
     4
 * 
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 2677
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 2677
diff changeset
     6
 * General Public License as published by the Free Software Foundation; either version 2 of the License,
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 2677
diff changeset
     7
 * or (at your option) any later version.
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 2677
diff changeset
     8
 * 
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 2677
diff changeset
     9
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 2677
diff changeset
    10
 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 2677
diff changeset
    11
 * Public License for more details.
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 2677
diff changeset
    12
 * 
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 2677
diff changeset
    13
 * You should have received a copy of the GNU General Public License along with this program; if not,
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 2677
diff changeset
    14
 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
f4294bb53b0f Bring consistency to file headings, this is not exhaustive. Evan and the rest.
Frank Dowsett <wixardy@adium.im>
parents: 2677
diff changeset
    15
 */
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    16
#import "TestDictionaryAdditions.h"
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    17
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    18
#import <AIUtilities/AIDictionaryAdditions.h>
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    19
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    20
@implementation TestDictionaryAdditions
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    21
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    22
- (NSMutableDictionary *)startingDictionary {
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    23
	return [NSMutableDictionary dictionaryWithObjectsAndKeys:
2677
43d104027d33 Correct for 64-bit type mismatches for our unit tests.
Stephen Holt <sholt@adium.im>
parents: 0
diff changeset
    24
		[NSNumber numberWithUnsignedInteger:0U], @"Foo",
43d104027d33 Correct for 64-bit type mismatches for our unit tests.
Stephen Holt <sholt@adium.im>
parents: 0
diff changeset
    25
		[NSNumber numberWithUnsignedInteger:1U], @"Bar",
43d104027d33 Correct for 64-bit type mismatches for our unit tests.
Stephen Holt <sholt@adium.im>
parents: 0
diff changeset
    26
		[NSNumber numberWithUnsignedInteger:2U], @"Baz",
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    27
		nil];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    28
}
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    29
- (NSDictionary *)translation {
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    30
	return [NSDictionary dictionaryWithObjectsAndKeys:
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    31
		@"Green", @"Foo",
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    32
		@"Red",   @"Bar",
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    33
		@"Blue",  @"Baz",
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    34
		nil];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    35
}
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    36
- (NSDictionary *)addition {
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    37
	return [NSDictionary dictionaryWithObjectsAndKeys:
2677
43d104027d33 Correct for 64-bit type mismatches for our unit tests.
Stephen Holt <sholt@adium.im>
parents: 0
diff changeset
    38
		[NSNumber numberWithUnsignedInteger:3U], @"Qux",
43d104027d33 Correct for 64-bit type mismatches for our unit tests.
Stephen Holt <sholt@adium.im>
parents: 0
diff changeset
    39
		[NSNumber numberWithUnsignedInteger:4U], @"Quux",
43d104027d33 Correct for 64-bit type mismatches for our unit tests.
Stephen Holt <sholt@adium.im>
parents: 0
diff changeset
    40
		[NSNumber numberWithUnsignedInteger:5U], @"Quuux",
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    41
		nil];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    42
}
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    43
- (NSSet *)deletia {
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    44
	return [NSSet setWithObjects:
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    45
		@"Foo",
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    46
		@"Bar",
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    47
		@"Baz",
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    48
		nil];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    49
}
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    50
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    51
#pragma mark Test case methods
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    52
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    53
- (void)testTranslateAddRemove_translate {
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    54
	NSMutableDictionary *dict = [self startingDictionary];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    55
	NSDictionary *translation = [self translation];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    56
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    57
	[dict translate:translation
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    58
				add:nil
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    59
			 remove:nil];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    60
5949
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
    61
	XCTAssertNotNil([dict objectForKey:[translation objectForKey:@"Foo"]], @"translate:add:remove: method failed to translate %@ to %@", @"Foo", [translation objectForKey:@"Foo"]);
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
    62
	XCTAssertNotNil([dict objectForKey:[translation objectForKey:@"Bar"]], @"translate:add:remove: method failed to translate %@ to %@", @"Bar", [translation objectForKey:@"Bar"]);
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
    63
	XCTAssertNotNil([dict objectForKey:[translation objectForKey:@"Baz"]], @"translate:add:remove: method failed to translate %@ to %@", @"Baz", [translation objectForKey:@"Baz"]);
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    64
}
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    65
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    66
- (void)testTranslateAddRemove_add {
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    67
	NSMutableDictionary *dict = [self startingDictionary];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    68
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    69
	[dict translate:nil
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    70
				add:[self addition]
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    71
			 remove:nil];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    72
5949
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
    73
	XCTAssertNotNil([dict objectForKey:@"Foo"],   @"translate:add:remove: method failed to keep %@", @"Foo");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
    74
	XCTAssertNotNil([dict objectForKey:@"Bar"],   @"translate:add:remove: method failed to keep %@", @"Bar");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
    75
	XCTAssertNotNil([dict objectForKey:@"Baz"],   @"translate:add:remove: method failed to keep %@", @"Baz");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
    76
	XCTAssertNotNil([dict objectForKey:@"Qux"],   @"translate:add:remove: method failed to add %@", @"Qux");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
    77
	XCTAssertNotNil([dict objectForKey:@"Quux"],  @"translate:add:remove: method failed to add %@", @"Quux");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
    78
	XCTAssertNotNil([dict objectForKey:@"Quuux"], @"translate:add:remove: method failed to add %@", @"Quuux");
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    79
}
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    80
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    81
- (void)testTranslateAddRemove_remove {
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    82
	NSMutableDictionary *dict = [self startingDictionary];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    83
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    84
	[dict translate:nil
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    85
				add:nil
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    86
			 remove:[self deletia]];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    87
5949
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
    88
	XCTAssertNil([dict objectForKey:@"Foo"], @"translate:add:remove: method failed to remove %@", @"Foo");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
    89
	XCTAssertNil([dict objectForKey:@"Bar"], @"translate:add:remove: method failed to remove %@", @"Bar");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
    90
	XCTAssertNil([dict objectForKey:@"Baz"], @"translate:add:remove: method failed to remove %@", @"Baz");
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    91
}
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    92
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    93
#pragma mark -
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    94
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    95
- (void)testTranslateAddRemove_translateAdd {
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    96
	NSMutableDictionary *dict = [self startingDictionary];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    97
	NSDictionary *translation = [self translation];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    98
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
    99
	[dict translate:translation
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   100
				add:[self addition]
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   101
			 remove:nil];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   102
5949
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   103
	XCTAssertNotNil([dict objectForKey:[translation objectForKey:@"Foo"]], @"translate:add:remove: method failed to translate %@ to %@", @"Foo", [translation objectForKey:@"Foo"]);
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   104
	XCTAssertNotNil([dict objectForKey:[translation objectForKey:@"Bar"]], @"translate:add:remove: method failed to translate %@ to %@", @"Bar", [translation objectForKey:@"Bar"]);
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   105
	XCTAssertNotNil([dict objectForKey:[translation objectForKey:@"Baz"]], @"translate:add:remove: method failed to translate %@ to %@", @"Baz", [translation objectForKey:@"Baz"]);
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   106
5949
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   107
	XCTAssertNotNil([dict objectForKey:@"Foo"],   @"translate:add:remove: method failed to keep %@", @"Foo");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   108
	XCTAssertNotNil([dict objectForKey:@"Bar"],   @"translate:add:remove: method failed to keep %@", @"Bar");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   109
	XCTAssertNotNil([dict objectForKey:@"Baz"],   @"translate:add:remove: method failed to keep %@", @"Baz");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   110
	XCTAssertNotNil([dict objectForKey:@"Qux"],   @"translate:add:remove: method failed to add %@", @"Qux");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   111
	XCTAssertNotNil([dict objectForKey:@"Quux"],  @"translate:add:remove: method failed to add %@", @"Quux");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   112
	XCTAssertNotNil([dict objectForKey:@"Quuux"], @"translate:add:remove: method failed to add %@", @"Quuux");
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   113
}
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   114
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   115
- (void)testTranslateAddRemove_translateRemove {
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   116
	NSMutableDictionary *dict = [self startingDictionary];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   117
	NSDictionary *translation = [self translation];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   118
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   119
	[dict translate:translation
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   120
				add:nil
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   121
			 remove:[self deletia]];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   122
5949
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   123
	XCTAssertNotNil([dict objectForKey:[translation objectForKey:@"Foo"]], @"translate:add:remove: method failed to translate %@ to %@", @"Foo", [translation objectForKey:@"Foo"]);
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   124
	XCTAssertNotNil([dict objectForKey:[translation objectForKey:@"Bar"]], @"translate:add:remove: method failed to translate %@ to %@", @"Bar", [translation objectForKey:@"Bar"]);
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   125
	XCTAssertNotNil([dict objectForKey:[translation objectForKey:@"Baz"]], @"translate:add:remove: method failed to translate %@ to %@", @"Baz", [translation objectForKey:@"Baz"]);
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   126
5949
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   127
	XCTAssertNil([dict objectForKey:@"Foo"], @"translate:add:remove: method failed to remove %@", @"Foo");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   128
	XCTAssertNil([dict objectForKey:@"Bar"], @"translate:add:remove: method failed to remove %@", @"Bar");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   129
	XCTAssertNil([dict objectForKey:@"Baz"], @"translate:add:remove: method failed to remove %@", @"Baz");
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   130
}
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   131
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   132
- (void)testTranslateAddRemove_addRemove {
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   133
	NSMutableDictionary *dict = [self startingDictionary];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   134
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   135
	[dict translate:nil
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   136
				add:[self addition]
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   137
			 remove:[self deletia]];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   138
5949
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   139
	XCTAssertNotNil([dict objectForKey:@"Qux"],   @"translate:add:remove: method failed to add %@", @"Qux");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   140
	XCTAssertNotNil([dict objectForKey:@"Quux"],  @"translate:add:remove: method failed to add %@", @"Quux");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   141
	XCTAssertNotNil([dict objectForKey:@"Quuux"], @"translate:add:remove: method failed to add %@", @"Quuux");
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   142
5949
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   143
	XCTAssertNil([dict objectForKey:@"Foo"], @"translate:add:remove: method failed to remove %@", @"Foo");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   144
	XCTAssertNil([dict objectForKey:@"Bar"], @"translate:add:remove: method failed to remove %@", @"Bar");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   145
	XCTAssertNil([dict objectForKey:@"Baz"], @"translate:add:remove: method failed to remove %@", @"Baz");
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   146
}
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   147
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   148
#pragma mark -
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   149
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   150
- (void)testTranslateAddRemove_translateAddRemove {
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   151
	NSMutableDictionary *dict = [self startingDictionary];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   152
	NSDictionary *translation = [self translation];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   153
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   154
	[dict translate:translation
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   155
				add:[self addition]
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   156
			 remove:[self deletia]];
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   157
5949
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   158
	XCTAssertNotNil([dict objectForKey:[translation objectForKey:@"Foo"]], @"translate:add:remove: method failed to translate %@ to %@", @"Foo", [translation objectForKey:@"Foo"]);
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   159
	XCTAssertNotNil([dict objectForKey:[translation objectForKey:@"Bar"]], @"translate:add:remove: method failed to translate %@ to %@", @"Bar", [translation objectForKey:@"Bar"]);
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   160
	XCTAssertNotNil([dict objectForKey:[translation objectForKey:@"Baz"]], @"translate:add:remove: method failed to translate %@ to %@", @"Baz", [translation objectForKey:@"Baz"]);
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   161
5949
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   162
	XCTAssertNotNil([dict objectForKey:@"Qux"],   @"translate:add:remove: method failed to add %@", @"Qux");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   163
	XCTAssertNotNil([dict objectForKey:@"Quux"],  @"translate:add:remove: method failed to add %@", @"Quux");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   164
	XCTAssertNotNil([dict objectForKey:@"Quuux"], @"translate:add:remove: method failed to add %@", @"Quuux");
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   165
5949
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   166
	XCTAssertNil([dict objectForKey:@"Foo"], @"translate:add:remove: method failed to remove %@", @"Foo");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   167
	XCTAssertNil([dict objectForKey:@"Bar"], @"translate:add:remove: method failed to remove %@", @"Bar");
334dc418b409 Transition Adium from SenTestingKit to XCTest.
Matthew Kotila
parents: 3679
diff changeset
   168
	XCTAssertNil([dict objectForKey:@"Baz"], @"translate:add:remove: method failed to remove %@", @"Baz");
0
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   169
}
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   170
e22ad6bc8b46 svn 1.5 merge tracking is terrible. This is a manual merge of the Sparkle 1.5 branch into trunk
David Smith
parents:
diff changeset
   171
@end