mirror of https://github.com/oxen-io/session-ios
Contacts don't have safety numbers until they've exchanged keys.
// FREEBIEpull/1/head
parent
2e06bb148f
commit
1ebb82f987
@ -0,0 +1,38 @@
|
||||
// Created by Michael Kirk on 11/7/16.
|
||||
// Copyright © 2016 Open Whisper Systems. All rights reserved.
|
||||
|
||||
#import "TSContactThread.h"
|
||||
#import "TSStorageManager+identityKeyStore.h"
|
||||
#import <XCTest/XCTest.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TSContactThreadTest : XCTestCase
|
||||
|
||||
@property (nonatomic) TSContactThread *contactThread;
|
||||
|
||||
@end
|
||||
|
||||
@implementation TSContactThreadTest
|
||||
|
||||
- (void)setUp
|
||||
{
|
||||
self.contactThread = [TSContactThread getOrCreateThreadWithContactId:@"fake-contact-id"];
|
||||
[self.contactThread.storageManager removeIdentityKeyForRecipient:self.contactThread.contactIdentifier];
|
||||
}
|
||||
|
||||
- (void)testHasSafetyNumbersWithoutRemoteIdentity
|
||||
{
|
||||
XCTAssertFalse(self.contactThread.hasSafetyNumbers);
|
||||
}
|
||||
|
||||
- (void)testHasSafetyNumbersWithRemoteIdentity
|
||||
{
|
||||
[self.contactThread.storageManager saveRemoteIdentity:[NSData new]
|
||||
recipientId:self.contactThread.contactIdentifier];
|
||||
XCTAssert(self.contactThread.hasSafetyNumbers);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@ -0,0 +1,23 @@
|
||||
// Created by Michael Kirk on 11/7/16.
|
||||
// Copyright © 2016 Open Whisper Systems. All rights reserved.
|
||||
|
||||
#import "TSGroupThread.h"
|
||||
#import <XCTest/XCTest.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TSGroupThreadTest : XCTestCase
|
||||
|
||||
@end
|
||||
|
||||
@implementation TSGroupThreadTest
|
||||
|
||||
- (void)testHasSafetyNumbers
|
||||
{
|
||||
TSGroupThread *groupThread = [TSGroupThread new];
|
||||
XCTAssertFalse(groupThread.hasSafetyNumbers);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
Loading…
Reference in New Issue