IOSAD-103 wait for messages (with XCT KVO expectation) IOSAD-103
authorDirk Zimmermann <dirk@pep-project.org>
Wed, 31 Oct 2018 16:38:25 +0100
branchIOSAD-103
changeset 745fb63476f9adc
parent 744 cb9231c6fc83
child 746 dbb0deb87940
IOSAD-103 wait for messages (with XCT KVO expectation)
pEpObjCTests/PEPSessionTest.m
     1.1 --- a/pEpObjCTests/PEPSessionTest.m	Wed Oct 31 16:38:25 2018 +0100
     1.2 +++ b/pEpObjCTests/PEPSessionTest.m	Wed Oct 31 16:38:25 2018 +0100
     1.3 @@ -1225,6 +1225,12 @@
     1.4      XCTAssertNotNil(identMe.fingerPrint);
     1.5      XCTAssertNotEqual(identMe.fingerPrint, fpr1);
     1.6  
     1.7 +    XCTKVOExpectation *expHaveMessage = [[XCTKVOExpectation alloc]
     1.8 +                                         initWithKeyPath:@"lastMessage"
     1.9 +                                         object:self.sendMessageDelegate];
    1.10 +
    1.11 +    [self waitForExpectations:@[expHaveMessage] timeout:1000];
    1.12 +
    1.13      XCTAssertEqual(self.sendMessageDelegate.messages.count, 1);
    1.14  }
    1.15