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.
42 lines
988 B
Matlab
42 lines
988 B
Matlab
8 years ago
|
//
|
||
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||
|
//
|
||
9 years ago
|
|
||
|
#import "TSContactThread.h"
|
||
8 years ago
|
#import "OWSIdentityManager.h"
|
||
8 years ago
|
#import "OWSUnitTestEnvironment.h"
|
||
9 years ago
|
#import <XCTest/XCTest.h>
|
||
|
|
||
|
NS_ASSUME_NONNULL_BEGIN
|
||
|
|
||
|
@interface TSContactThreadTest : XCTestCase
|
||
|
|
||
|
@property (nonatomic) TSContactThread *contactThread;
|
||
|
|
||
|
@end
|
||
|
|
||
|
@implementation TSContactThreadTest
|
||
|
|
||
|
- (void)setUp
|
||
|
{
|
||
8 years ago
|
[OWSUnitTestEnvironment ensureSetup];
|
||
9 years ago
|
self.contactThread = [TSContactThread getOrCreateThreadWithContactId:@"fake-contact-id"];
|
||
8 years ago
|
[OWSRecipientIdentity removeAllObjectsInCollection];
|
||
9 years ago
|
}
|
||
|
|
||
|
- (void)testHasSafetyNumbersWithoutRemoteIdentity
|
||
|
{
|
||
|
XCTAssertFalse(self.contactThread.hasSafetyNumbers);
|
||
|
}
|
||
|
|
||
|
- (void)testHasSafetyNumbersWithRemoteIdentity
|
||
|
{
|
||
8 years ago
|
[[OWSIdentityManager sharedManager] saveRemoteIdentity:[NSData new]
|
||
|
recipientId:self.contactThread.contactIdentifier];
|
||
9 years ago
|
XCTAssert(self.contactThread.hasSafetyNumbers);
|
||
|
}
|
||
|
|
||
|
@end
|
||
|
|
||
|
NS_ASSUME_NONNULL_END
|