aboutsummaryrefslogtreecommitdiffstats
path: root/Framework/MASDictionaryTransformerTests.m
diff options
context:
space:
mode:
authorTomáš Znamenáček2014-08-07 11:35:45 +0200
committerTomáš Znamenáček2015-01-07 15:42:22 +0100
commitbbf2f69da4253b9fc28bd622a3041622f064d22c (patch)
treee73b5c0c1a6bfbe481ff904829a45a49375d608d /Framework/MASDictionaryTransformerTests.m
parentd687545083839db1218ab874f59a7290d516b46b (diff)
downloadMASShortcut-bbf2f69da4253b9fc28bd622a3041622f064d22c.tar.bz2
Better treatment of nil values when storing shortcuts as dictionaries.
This makes it possible to make a difference between “shortcut not set, use default” and “shortcut set to none”.
Diffstat (limited to 'Framework/MASDictionaryTransformerTests.m')
-rw-r--r--Framework/MASDictionaryTransformerTests.m9
1 files changed, 9 insertions, 0 deletions
diff --git a/Framework/MASDictionaryTransformerTests.m b/Framework/MASDictionaryTransformerTests.m
index bd5c1db..48e11f3 100644
--- a/Framework/MASDictionaryTransformerTests.m
+++ b/Framework/MASDictionaryTransformerTests.m
@@ -20,4 +20,13 @@
@"Decoding a shortcut from an incomplete dictionary returns nil.");
}
+- (void) testNilRepresentation
+{
+ MASDictionaryTransformer *transformer = [MASDictionaryTransformer new];
+ XCTAssertEqualObjects([transformer reverseTransformedValue:nil], [NSDictionary dictionary],
+ @"Store nil values as an empty dictionary.");
+ XCTAssertNil([transformer transformedValue:[NSDictionary dictionary]],
+ @"Load empty dictionary as nil.");
+}
+
@end