Signal-iOS/SignalServiceKit/tests/Account/TSAttributesTest.m
Michael Kirk ccb4a88742 Import SSK (and history) into Signal-iOS
git remote add ssk ../SignalServiceKit
git remote update
git merge -s ours --allow-unrelated-histories --no-commit ssk/master
git read-tree --prefix=SignalServiceKit -u ssk/master
git commit
2017-07-21 13:55:01 -04:00

44 lines
1.1 KiB
Objective-C

//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import <XCTest/XCTest.h>
#import "TSAttributes.h"
#import "TSAccountManager.h"
@interface TSAttributesTest : XCTestCase
@end
@implementation TSAttributesTest
- (void)setUp {
[super 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.
[super tearDown];
}
- (void)testAttributesWithSignalingKey {
NSString *registrationId = [NSString stringWithFormat:@"%i", [TSAccountManager getOrGenerateRegistrationId]];
NSDictionary *expected = @{
@"AuthKey" : @"fake-server-auth-token",
@"registrationId" : registrationId,
@"signalingKey" : @"fake-signaling-key",
@"video" : @1,
@"voice" : @1
};
NSDictionary *actual = [TSAttributes attributesWithSignalingKey:@"fake-signaling-key"
serverAuthToken:@"fake-server-auth-token"];
XCTAssertEqualObjects(expected, actual);
}
@end