pEpObjCTests/PepTests.m
author Dirk Zimmermann <dirk@pep-project.org>
Tue, 24 Apr 2018 13:29:19 +0200
branchIOSAD-92
changeset 594 a9cae3a6f78d
parent 560 6bf2a4dd111b
child 738 7ac89df4a502
permissions -rw-r--r--
IOSAD-92 PEPIdentity using hashBasedOnKeys etc.
dirk@139
     1
//
dirk@139
     2
//  PepTests.m
dirk@139
     3
//  pEpiOSAdapter
dirk@139
     4
//
dirk@139
     5
//  Created by Dirk Zimmermann on 01/08/16.
dirk@139
     6
//  Copyright © 2016 p≡p. All rights reserved.
dirk@139
     7
//
dirk@139
     8
dirk@139
     9
#import <XCTest/XCTest.h>
dirk@139
    10
dirk@189
    11
#import "PEPObjCAdapter.h"
dirk@189
    12
#import "PEPSession.h"
dirk@189
    13
#import "PEPLanguage.h"
dirk@139
    14
dirk@139
    15
@interface PepTests : XCTestCase
dirk@139
    16
@end
dirk@139
    17
dirk@139
    18
@implementation PepTests
dirk@139
    19
dirk@139
    20
- (void)setUp {
dirk@139
    21
    [super setUp];
dirk@184
    22
    [PEPObjCAdapter setupTrustWordsDB:[NSBundle bundleForClass:[self class]]];
dirk@139
    23
}
dirk@139
    24
dirk@139
    25
- (void)testSessionFinalization {
dirk@139
    26
    PEPSession *session = [[PEPSession alloc] init];
dirk@139
    27
    session = nil;
dirk@139
    28
}
dirk@139
    29
dirk@173
    30
- (void)testLanguageList {
dirk@173
    31
    PEPSession *session = [[PEPSession alloc] init];
dirk@560
    32
    NSError *error = nil;
dirk@560
    33
    NSArray<PEPLanguage *> *langs = [session languageListWithError:&error];
dirk@560
    34
    XCTAssertNil(error);
dirk@173
    35
    XCTAssertGreaterThan(langs.count, 0);
dirk@173
    36
    BOOL foundEn = NO;
dirk@173
    37
    for (PEPLanguage *lang in langs) {
dirk@173
    38
        if ([lang.code isEqualToString:@"en"]) {
dirk@173
    39
            foundEn = YES;
dirk@173
    40
        }
dirk@173
    41
    }
dirk@173
    42
    XCTAssertTrue(foundEn);
dirk@173
    43
}
dirk@173
    44
dirk@139
    45
@end