mirror of https://github.com/oxen-io/session-ios
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			44 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Matlab
		
	
		
		
			
		
	
	
			44 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Matlab
		
	
| 
								 
											9 years ago
										 
									 | 
							
								//
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								//  Copyright (c) 2017 Open Whisper Systems. All rights reserved.
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								//
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#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]];
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								    NSDictionary *expected = @{
							 | 
						||
| 
								 | 
							
								        @"AuthKey" : @"fake-server-auth-token",
							 | 
						||
| 
								 | 
							
								        @"registrationId" : registrationId,
							 | 
						||
| 
								 | 
							
								        @"signalingKey" : @"fake-signaling-key",
							 | 
						||
| 
								 | 
							
								        @"video" : @1,
							 | 
						||
| 
								 | 
							
								        @"voice" : @1
							 | 
						||
| 
								 | 
							
								    };
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								    NSDictionary *actual = [TSAttributes attributesWithSignalingKey:@"fake-signaling-key"
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								                                                    serverAuthToken:@"fake-server-auth-token"];
							 | 
						||
| 
								 
											9 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								    XCTAssertEqualObjects(expected, actual);
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								@end
							 |