summaryrefslogtreecommitdiff
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
parent2a122f9cddfd1759407bb115edbc9323035124ab (diff)
Fix NSDictionary deserialization warnings
* added test target with deserialization test
-rw-r--r--Juick.xcodeproj/project.pbxproj171
-rw-r--r--Juick/Helpers/User+UIView.h19
-rw-r--r--Juick/Helpers/User+UIView.m28
-rw-r--r--Juick/Model/Message.m4
-rw-r--r--Juick/Model/User.h2
-rw-r--r--Juick/Model/User.m15
-rw-r--r--Juick/ViewControllers/MessagesViewController.m1
-rw-r--r--Juick/ViewControllers/NewPostViewController.m1
-rw-r--r--JuickTests/Info.plist22
-rw-r--r--JuickTests/JuickTests.m43
10 files changed, 287 insertions, 19 deletions
diff --git a/Juick.xcodeproj/project.pbxproj b/Juick.xcodeproj/project.pbxproj
index 8ba5ad3..bf33391 100644
--- a/Juick.xcodeproj/project.pbxproj
+++ b/Juick.xcodeproj/project.pbxproj
@@ -7,6 +7,8 @@
objects = {
/* Begin PBXBuildFile section */
+ 77052FFF25D43C9D0058DCE6 /* JuickTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 77052FFE25D43C9D0058DCE6 /* JuickTests.m */; };
+ 7705301B25D4414D0058DCE6 /* User+UIView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7705301A25D4414D0058DCE6 /* User+UIView.m */; };
770C86E325117D78009B6404 /* UIView+Shimmer.m in Sources */ = {isa = PBXBuildFile; fileRef = 770C86E125117D78009B6404 /* UIView+Shimmer.m */; };
772B4E6C2199811E0029706E /* Entity.m in Sources */ = {isa = PBXBuildFile; fileRef = 772B4E6B2199811E0029706E /* Entity.m */; };
77317BAC181BBE8500D60005 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 77317BAB181BBE8500D60005 /* Foundation.framework */; };
@@ -65,6 +67,13 @@
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
+ 7705300125D43C9D0058DCE6 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 77317BA0181BBE8500D60005 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 77317BA7181BBE8500D60005;
+ remoteInfo = Juick;
+ };
7761135B21790B0300D350CD /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 77317BA0181BBE8500D60005 /* Project object */;
@@ -89,6 +98,11 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
+ 77052FFC25D43C9D0058DCE6 /* JuickTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JuickTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ 77052FFE25D43C9D0058DCE6 /* JuickTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JuickTests.m; sourceTree = "<group>"; };
+ 7705300025D43C9D0058DCE6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 7705301925D4414D0058DCE6 /* User+UIView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "User+UIView.h"; sourceTree = "<group>"; };
+ 7705301A25D4414D0058DCE6 /* User+UIView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "User+UIView.m"; sourceTree = "<group>"; };
770A428F1E8881CB000B206A /* DeviceRegistration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceRegistration.h; sourceTree = "<group>"; };
770C86E125117D78009B6404 /* UIView+Shimmer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIView+Shimmer.m"; path = "Vendor/UIView-Shimmer/Classes/UIView+Shimmer.m"; sourceTree = "<group>"; };
770C86E225117D78009B6404 /* UIView+Shimmer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIView+Shimmer.h"; path = "Vendor/UIView-Shimmer/Classes/UIView+Shimmer.h"; sourceTree = "<group>"; };
@@ -189,6 +203,13 @@
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
+ 77052FF925D43C9D0058DCE6 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
77317BA5181BBE8500D60005 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -214,11 +235,21 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
+ 77052FFD25D43C9D0058DCE6 /* JuickTests */ = {
+ isa = PBXGroup;
+ children = (
+ 77052FFE25D43C9D0058DCE6 /* JuickTests.m */,
+ 7705300025D43C9D0058DCE6 /* Info.plist */,
+ );
+ path = JuickTests;
+ sourceTree = "<group>";
+ };
77317B9F181BBE8500D60005 = {
isa = PBXGroup;
children = (
774746B1239F85920001C7F9 /* Vendor */,
7761135621790B0300D350CD /* JuickPush */,
+ 77052FFD25D43C9D0058DCE6 /* JuickTests */,
77317BAA181BBE8500D60005 /* Frameworks */,
77317BB1181BBE8500D60005 /* Juick */,
77317BA9181BBE8500D60005 /* Products */,
@@ -230,6 +261,7 @@
children = (
77317BA8181BBE8500D60005 /* Juick.app */,
7761135521790B0200D350CD /* JuickPush.appex */,
+ 77052FFC25D43C9D0058DCE6 /* JuickTests.xctest */,
);
name = Products;
sourceTree = "<group>";
@@ -357,6 +389,8 @@
7785605F2343D24E00BB37A2 /* NSData+Hex.m */,
774746AB239F82A10001C7F9 /* NSDate+TimeAgo.h */,
774746AC239F82A10001C7F9 /* NSDate+TimeAgo.m */,
+ 7705301925D4414D0058DCE6 /* User+UIView.h */,
+ 7705301A25D4414D0058DCE6 /* User+UIView.m */,
);
path = Helpers;
sourceTree = "<group>";
@@ -400,6 +434,24 @@
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
+ 77052FFB25D43C9D0058DCE6 /* JuickTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 7705300625D43C9D0058DCE6 /* Build configuration list for PBXNativeTarget "JuickTests" */;
+ buildPhases = (
+ 77052FF825D43C9D0058DCE6 /* Sources */,
+ 77052FF925D43C9D0058DCE6 /* Frameworks */,
+ 77052FFA25D43C9D0058DCE6 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 7705300225D43C9D0058DCE6 /* PBXTargetDependency */,
+ );
+ name = JuickTests;
+ productName = JuickTests;
+ productReference = 77052FFC25D43C9D0058DCE6 /* JuickTests.xctest */;
+ productType = "com.apple.product-type.bundle.unit-test";
+ };
77317BA7181BBE8500D60005 /* Juick */ = {
isa = PBXNativeTarget;
buildConfigurationList = 77317BDD181BBE8500D60005 /* Build configuration list for PBXNativeTarget "Juick" */;
@@ -445,6 +497,12 @@
LastUpgradeCheck = 1200;
ORGANIZATIONNAME = com.juick;
TargetAttributes = {
+ 77052FFB25D43C9D0058DCE6 = {
+ CreatedOnToolsVersion = 12.4;
+ DevelopmentTeam = KH4MX79ZK7;
+ ProvisioningStyle = Automatic;
+ TestTargetID = 77317BA7181BBE8500D60005;
+ };
77317BA7181BBE8500D60005 = {
DevelopmentTeam = KH4MX79ZK7;
SystemCapabilities = {
@@ -481,11 +539,19 @@
targets = (
77317BA7181BBE8500D60005 /* Juick */,
7761135421790B0200D350CD /* JuickPush */,
+ 77052FFB25D43C9D0058DCE6 /* JuickTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
+ 77052FFA25D43C9D0058DCE6 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
77317BA6181BBE8500D60005 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -518,6 +584,14 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
+ 77052FF825D43C9D0058DCE6 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 77052FFF25D43C9D0058DCE6 /* JuickTests.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
77317BA4181BBE8500D60005 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -548,6 +622,7 @@
778560602343D24E00BB37A2 /* NSData+Hex.m in Sources */,
776C41BD1FD3EF180063B82E /* MessageCell.m in Sources */,
77317BB8181BBE8500D60005 /* main.m in Sources */,
+ 7705301B25D4414D0058DCE6 /* User+UIView.m in Sources */,
77B8B39C207A5629005CB20C /* MessageInputView.m in Sources */,
77C3648C2241B3060017522C /* DeviceRegistration.m in Sources */,
774528C21F930C06004D110B /* Attachment.m in Sources */,
@@ -566,6 +641,11 @@
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
+ 7705300225D43C9D0058DCE6 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 77317BA7181BBE8500D60005 /* Juick */;
+ targetProxy = 7705300125D43C9D0058DCE6 /* PBXContainerItemProxy */;
+ };
7761135C21790B0300D350CD /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 7761135421790B0200D350CD /* JuickPush */;
@@ -586,6 +666,87 @@
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
+ 7705300325D43C9D0058DCE6 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CODE_SIGN_STYLE = Automatic;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ DEVELOPMENT_TEAM = KH4MX79ZK7;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ INFOPLIST_FILE = JuickTests/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 14.4;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ PRODUCT_BUNDLE_IDENTIFIER = com.juick.JuickTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Juick.app/Juick";
+ };
+ name = Debug;
+ };
+ 7705300425D43C9D0058DCE6 /* Debug (local) */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CODE_SIGN_STYLE = Automatic;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ DEVELOPMENT_TEAM = KH4MX79ZK7;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ INFOPLIST_FILE = JuickTests/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 14.4;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ PRODUCT_BUNDLE_IDENTIFIER = com.juick.JuickTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Juick.app/Juick";
+ };
+ name = "Debug (local)";
+ };
+ 7705300525D43C9D0058DCE6 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ BUNDLE_LOADER = "$(TEST_HOST)";
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CODE_SIGN_STYLE = Automatic;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ DEVELOPMENT_TEAM = KH4MX79ZK7;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ INFOPLIST_FILE = JuickTests/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 14.4;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ PRODUCT_BUNDLE_IDENTIFIER = com.juick.JuickTests;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Juick.app/Juick";
+ };
+ name = Release;
+ };
77317BDB181BBE8500D60005 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 77D40ABB218B5CC90074E14F /* Production.xcconfig */;
@@ -908,6 +1069,16 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
+ 7705300625D43C9D0058DCE6 /* Build configuration list for PBXNativeTarget "JuickTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 7705300325D43C9D0058DCE6 /* Debug */,
+ 7705300425D43C9D0058DCE6 /* Debug (local) */,
+ 7705300525D43C9D0058DCE6 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
77317BA3181BBE8500D60005 /* Build configuration list for PBXProject "Juick" */ = {
isa = XCConfigurationList;
buildConfigurations = (
diff --git a/Juick/Helpers/User+UIView.h b/Juick/Helpers/User+UIView.h
new file mode 100644
index 0000000..d2f75ce
--- /dev/null
+++ b/Juick/Helpers/User+UIView.h
@@ -0,0 +1,19 @@
+//
+// User+User_UIView.h
+// Juick
+//
+// Created by Vitaly Takmazov on 10.02.2021.
+// Copyright © 2021 com.juick. All rights reserved.
+//
+
+#import "User.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface User (UIView)
+
++ (void) throwUnableToLogin:(UIViewController *)view error:(NSError *)error path:(NSString *)path params:(NSDictionary * _Nullable)params;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/Juick/Helpers/User+UIView.m b/Juick/Helpers/User+UIView.m
new file mode 100644
index 0000000..4fb0bc3
--- /dev/null
+++ b/Juick/Helpers/User+UIView.m
@@ -0,0 +1,28 @@
+//
+// User+User_UIView.m
+// Juick
+//
+// Created by Vitaly Takmazov on 10.02.2021.
+// Copyright © 2021 com.juick. All rights reserved.
+//
+
+#import "User+UIView.h"
+
+@implementation User (UIView)
+
++(void) throwUnableToLogin:(UIViewController *)view error:(NSError *)error path:(NSString *)path params:(NSDictionary *)params {
+ UIAlertController *alert = [UIAlertController new];
+ NSString *title = error.userInfo[@"url"] ? error.userInfo[@"url"] : @"Something went wrong";
+ [alert setTitle:title];
+ [alert setMessage:[NSString stringWithFormat:@"err: %@, path: %@, params: %@", error.localizedDescription, path, params]];
+ [alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:nil]];
+ UIPopoverPresentationController *popover = [alert popoverPresentationController];
+ if (popover) {
+ popover.sourceView = view.view;
+ popover.sourceRect = CGRectMake(CGRectGetMidX(view.view.bounds), CGRectGetMidY(view.view.bounds), 0, 0);
+ popover.permittedArrowDirections = UIPopoverArrowDirectionDown;
+ }
+ [view presentViewController:alert animated:YES completion:nil];
+}
+
+@end
diff --git a/Juick/Model/Message.m b/Juick/Model/Message.m
index d39be54..0319543 100644
--- a/Juick/Model/Message.m
+++ b/Juick/Model/Message.m
@@ -20,8 +20,8 @@
message.repliesBy = jsonData[@"repliesby"];
message.user = [User fromJSON:jsonData[@"user"]];
message.timestamp = jsonData[@"timestamp"];
- message.service = jsonData[@"service"];
- message.unread = jsonData[@"unread"];
+ message.service = [[jsonData objectForKey:@"service"] boolValue];
+ message.unread = [[jsonData objectForKey:@"unread"] boolValue];
message.tags = jsonData[@"tags"];
NSMutableArray *entitiesArray = [NSMutableArray new];
for (NSDictionary *entityData in jsonData[@"entities"]) {
diff --git a/Juick/Model/User.h b/Juick/Model/User.h
index cb63ebc..5393c3d 100644
--- a/Juick/Model/User.h
+++ b/Juick/Model/User.h
@@ -18,6 +18,4 @@
+ (User *) fromJSON:(NSDictionary *)jsonData;
-+ (void) throwUnableToLogin:(UIViewController *)view error:(NSError *)error path:(NSString *)path params:(NSDictionary *)params;
-
@end
diff --git a/Juick/Model/User.m b/Juick/Model/User.m
index ee3cce8..2401c7e 100644
--- a/Juick/Model/User.m
+++ b/Juick/Model/User.m
@@ -21,19 +21,4 @@
return user;
}
-+(void) throwUnableToLogin:(UIViewController *)view error:(NSError *)error path:(NSString *)path params:(NSDictionary *)params {
- UIAlertController *alert = [UIAlertController new];
- NSString *title = error.userInfo[@"url"] ? error.userInfo[@"url"] : @"Something went wrong";
- [alert setTitle:title];
- [alert setMessage:[NSString stringWithFormat:@"err: %@, path: %@, params: %@", error.localizedDescription, path, params]];
- [alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:nil]];
- UIPopoverPresentationController *popover = [alert popoverPresentationController];
- if (popover) {
- popover.sourceView = view.view;
- popover.sourceRect = CGRectMake(CGRectGetMidX(view.view.bounds), CGRectGetMidY(view.view.bounds), 0, 0);
- popover.permittedArrowDirections = UIPopoverArrowDirectionDown;
- }
- [view presentViewController:alert animated:YES completion:nil];
-}
-
@end
diff --git a/Juick/ViewControllers/MessagesViewController.m b/Juick/ViewControllers/MessagesViewController.m
index e58baae..d3bd8aa 100644
--- a/Juick/ViewControllers/MessagesViewController.m
+++ b/Juick/ViewControllers/MessagesViewController.m
@@ -15,6 +15,7 @@
#import "LoginViewController.h"
#import "ThreadViewController.h"
#import "BlogViewController.h"
+#import "User+UIView.h"
NSString* const messageCellIdentifier = @"messageCell";
diff --git a/Juick/ViewControllers/NewPostViewController.m b/Juick/ViewControllers/NewPostViewController.m
index 990410b..03a27e3 100644
--- a/Juick/ViewControllers/NewPostViewController.m
+++ b/Juick/ViewControllers/NewPostViewController.m
@@ -9,6 +9,7 @@
#import "NewPostViewController.h"
#import "MessagesViewController.h"
#import "QuoteView.h"
+#import "User+UIView.h"
NSString * const NewMessageNotificationName = @"NewMessage";
NSString * const ReplyPostedNotificationName = @"ReplyPosted";
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