summaryrefslogtreecommitdiff
path: root/JuickTests/JuickTests.m
diff options
context:
space:
mode:
Diffstat (limited to 'JuickTests/JuickTests.m')
-rw-r--r--JuickTests/JuickTests.m43
1 files changed, 43 insertions, 0 deletions
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