mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00

git-subtree-dir: submodules/HockeySDK-iOS git-subtree-mainline: 085acd26c4432939403765234266e3c1be0f3dd9 git-subtree-split: c7d0c7026303253e2ac576c02655691e5d314fe2
60 lines
1.7 KiB
Objective-C
60 lines
1.7 KiB
Objective-C
#import <XCTest/XCTest.h>
|
|
#import "BITSession.h"
|
|
|
|
@interface BITSessionTests : XCTestCase
|
|
|
|
@end
|
|
|
|
@implementation BITSessionTests
|
|
|
|
- (void)testidPropertyWorksAsExpected {
|
|
NSString *expected = @"Test string";
|
|
BITSession *item = [BITSession new];
|
|
item.sessionId = expected;
|
|
NSString *actual = item.sessionId;
|
|
XCTAssertTrue([actual isEqualToString:expected]);
|
|
|
|
expected = @"Other string";
|
|
item.sessionId = expected;
|
|
actual = item.sessionId;
|
|
XCTAssertTrue([actual isEqualToString:expected]);
|
|
}
|
|
|
|
- (void)testis_firstPropertyWorksAsExpected {
|
|
NSString *expected = @"Test string";
|
|
BITSession *item = [BITSession new];
|
|
item.isFirst = expected;
|
|
NSString *actual = item.isFirst;
|
|
XCTAssertTrue([actual isEqualToString:expected]);
|
|
|
|
expected = @"Other string";
|
|
item.isFirst = expected;
|
|
actual = item.isFirst;
|
|
XCTAssertTrue([actual isEqualToString:expected]);
|
|
}
|
|
|
|
- (void)testis_newPropertyWorksAsExpected {
|
|
NSString *expected = @"Test string";
|
|
BITSession *item = [BITSession new];
|
|
item.isNew = expected;
|
|
NSString *actual = item.isNew;
|
|
XCTAssertTrue([actual isEqualToString:expected]);
|
|
|
|
expected = @"Other string";
|
|
item.isNew = expected;
|
|
actual = item.isNew;
|
|
XCTAssertTrue([actual isEqualToString:expected]);
|
|
}
|
|
|
|
- (void)testSerialize {
|
|
BITSession *item = [BITSession new];
|
|
item.sessionId = @"Test string";
|
|
item.isFirst = @"Test string";
|
|
item.isNew = @"Test string";
|
|
NSDictionary *actual = [item serializeToDictionary];
|
|
NSDictionary *expected = @{@"ai.session.id":@"Test string", @"ai.session.isFirst":@"Test string", @"ai.session.isNew":@"Test string"};
|
|
XCTAssertTrue([actual isEqualToDictionary:expected]);
|
|
}
|
|
|
|
@end
|