IOSAD-103 PEPSessionTest using PEPSync IOSAD-103
authorDirk Zimmermann <dirk@pep-project.org>
Fri, 05 Oct 2018 16:35:52 +0200
branchIOSAD-103
changeset 706ac8faad5196d
parent 705 90b7d3ed756c
child 707 d6863986101a
IOSAD-103 PEPSessionTest using PEPSync
pEpObjCTests/PEPSessionTest.m
     1.1 --- a/pEpObjCTests/PEPSessionTest.m	Fri Oct 05 16:35:52 2018 +0200
     1.2 +++ b/pEpObjCTests/PEPSessionTest.m	Fri Oct 05 16:35:52 2018 +0200
     1.3 @@ -14,8 +14,24 @@
     1.4  #import "PEPMessage.h"
     1.5  #import "PEPAttachment.h"
     1.6  #import "PEPTestUtils.h"
     1.7 +#import "PEPSync.h"
     1.8 +#import "PEPSyncSendMessageDelegate.h"
     1.9 +#import "PEPNotifyHandshakeDelegate.h"
    1.10 +
    1.11 +@interface SendDelegate : NSObject<PEPSyncSendMessageDelegate>
    1.12 +
    1.13 +@end
    1.14 +
    1.15 +@interface NotifyHandshakeDelegate : NSObject<PEPNotifyHandshakeDelegate>
    1.16 +
    1.17 +@end
    1.18  
    1.19  @interface PEPSessionTest : XCTestCase
    1.20 +
    1.21 +@property (nonatomic) PEPSync *sync;
    1.22 +@property (nonatomic) SendDelegate *sendMessageDelegate;
    1.23 +@property (nonatomic) NotifyHandshakeDelegate *notifyHandshakeDelegate;
    1.24 +
    1.25  @end
    1.26  
    1.27  @implementation PEPSessionTest
    1.28 @@ -23,6 +39,11 @@
    1.29  - (void)setUp
    1.30  {
    1.31      [super setUp];
    1.32 +
    1.33 +    self.sync = [[PEPSync alloc]
    1.34 +                 initWithSyncSendMessageDelegate:self.sendMessageDelegate
    1.35 +                 notifyHandshakeDelegate:self.notifyHandshakeDelegate];
    1.36 +
    1.37      [PEPObjCAdapter setUnEncryptedSubjectEnabled:NO];
    1.38  
    1.39      [self pEpCleanUp];
    1.40 @@ -30,6 +51,8 @@
    1.41  
    1.42  - (void)tearDown
    1.43  {
    1.44 +    [self.sync shutdown];
    1.45 +
    1.46      [self pEpCleanUp];
    1.47      [super tearDown];
    1.48  }