summaryrefslogtreecommitdiff
path: root/JuickTests
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2021-02-10 19:42:20 +0300
committerGravatar Vitaly Takmazov2021-02-10 19:47:34 +0300
commit7a969d40babccbb8bdddb254d03e74c638b354a8 (patch)
treea464df11e7d001e03ce78a2dab34d585085fe986 /JuickTests
parent2a122f9cddfd1759407bb115edbc9323035124ab (diff)
Fix NSDictionary deserialization warnings
* added test target with deserialization test
Diffstat (limited to 'JuickTests')
-rw-r--r--JuickTests/Info.plist22
-rw-r--r--JuickTests/JuickTests.m43
2 files changed, 65 insertions, 0 deletions
diff --git a/JuickTests/Info.plist b/JuickTests/Info.plist
new file mode 100644
index 0000000..64d65ca
--- /dev/null
+++ b/JuickTests/Info.plist
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>$(DEVELOPMENT_LANGUAGE)</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
diff --git a/JuickTests/JuickTests.m b/JuickTests/JuickTests.m
new file mode 100644
index 0000000..6381bc6
--- /dev/null
+++ b/JuickTests/JuickTests.m
@@ -0,0 +1,43 @@
+//
+// JuickTests.m
+// JuickTests
+//
+// Created by Vitaly Takmazov on 10.02.2021.
+// Copyright © 2021 com.juick. All rights reserved.
+//
+
+@import UIKit;
+#import <XCTest/XCTest.h>
+#import "Message.h"
+
+@interface JuickTests : XCTestCase
+
+@end
+
+@implementation JuickTests
+
+- (void)setUp {
+ // Put setup code here. This method is called before the invocation of each test method in the class.
+}
+
+- (void)tearDown {
+ // Put teardown code here. This method is called after the invocation of each test method in the class.
+}
+
+- (void)testMessageDeserialization {
+ NSString *jsonData = @"{\"service\": true }";
+ NSError *jsonError;
+ NSDictionary *json = [NSJSONSerialization JSONObjectWithData:[jsonData dataUsingEncoding:NSUTF8StringEncoding] options:0 error:&jsonError];
+ Message *msg = [Message fromJSON:json];
+ XCTAssertTrue(msg.service);
+ XCTAssertFalse(msg.unread);
+}
+
+- (void)testPerformanceExample {
+ // This is an example of a performance test case.
+ [self measureBlock:^{
+ // Put the code you want to measure the time of here.
+ }];
+}
+
+@end