pEpObjCTests/PEPSessionTest.m
branchIOSAD-160
changeset 1375 693a6506fb50
parent 1358 8266b8194627
child 1376 8e4f3ff6694b
     1.1 --- a/pEpObjCTests/PEPSessionTest.m	Tue Dec 03 14:07:27 2019 +0100
     1.2 +++ b/pEpObjCTests/PEPSessionTest.m	Tue Dec 03 14:07:27 2019 +0100
     1.3 @@ -1266,6 +1266,33 @@
     1.4      }
     1.5  }
     1.6  
     1.7 +/// Test the disable of sync via myself.
     1.8 +- (void)testNoBeaconOnMyself
     1.9 +{
    1.10 +    PEPSession *session = [PEPSession new];
    1.11 +
    1.12 +    XCTAssertEqual(self.sendMessageDelegate.messages.count, 0);
    1.13 +    XCTAssertNil(self.sendMessageDelegate.lastMessage);
    1.14 +
    1.15 +    PEPIdentity *identMe = [[PEPIdentity alloc]
    1.16 +                            initWithAddress:@"me-myself-and-i@pep-project.org"
    1.17 +                            userID:@"me-myself-and-i"
    1.18 +                            userName:@"pEp Me"
    1.19 +                            isOwn:YES];
    1.20 +
    1.21 +    NSError *error = nil;
    1.22 +    XCTAssertTrue([session mySelf:identMe pEpSyncEnabled:NO error:&error]);
    1.23 +    XCTAssertNil(error);
    1.24 +
    1.25 +    [self startSync];
    1.26 +
    1.27 +    [NSThread sleepForTimeInterval:2];
    1.28 +    XCTAssertNil(self.sendMessageDelegate.lastMessage);
    1.29 +
    1.30 +    XCTAssertEqual(self.sendMessageDelegate.messages.count, 0);
    1.31 +    [self shutdownSync];
    1.32 +}
    1.33 +
    1.34  #pragma mark - key_reset_identity
    1.35  
    1.36  - (void)testKeyResetIdentity