From 7a969d40babccbb8bdddb254d03e74c638b354a8 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 10 Feb 2021 19:42:20 +0300 Subject: Fix NSDictionary deserialization warnings * added test target with deserialization test --- JuickTests/Info.plist | 22 ++++++++++++++++++++++ JuickTests/JuickTests.m | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 JuickTests/Info.plist create mode 100644 JuickTests/JuickTests.m (limited to 'JuickTests') 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 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + 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 +#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 -- cgit v1.2.3