pEpObjCTests/PepTests.m
author Dirk Zimmermann <dz@pep.security>
Thu, 21 Mar 2019 12:45:12 +0100
branchIOS-1480
changeset 904 fe9563f1982b
parent 738 7ac89df4a502
permissions -rw-r--r--
IOS-1480 Close branch.
     1 //
     2 //  PepTests.m
     3 //  pEpiOSAdapter
     4 //
     5 //  Created by Dirk Zimmermann on 01/08/16.
     6 //  Copyright © 2016 p≡p. All rights reserved.
     7 //
     8 
     9 #import <XCTest/XCTest.h>
    10 
    11 #import "PEPObjCAdapter.h"
    12 #import "PEPSession.h"
    13 #import "PEPLanguage.h"
    14 
    15 @interface PepTests : XCTestCase
    16 @end
    17 
    18 @implementation PepTests
    19 
    20 - (void)setUp {
    21     [super setUp];
    22     [PEPObjCAdapter setupTrustWordsDB:[NSBundle bundleForClass:[self class]]];
    23 }
    24 
    25 - (void)tearDown
    26 {
    27     [PEPSession cleanup];
    28 }
    29 
    30 - (void)testSessionFinalization {
    31     PEPSession *session = [[PEPSession alloc] init];
    32     session = nil;
    33 }
    34 
    35 - (void)testLanguageList {
    36     PEPSession *session = [[PEPSession alloc] init];
    37     NSError *error = nil;
    38     NSArray<PEPLanguage *> *langs = [session languageListWithError:&error];
    39     XCTAssertNil(error);
    40     XCTAssertGreaterThan(langs.count, 0);
    41     BOOL foundEn = NO;
    42     for (PEPLanguage *lang in langs) {
    43         if ([lang.code isEqualToString:@"en"]) {
    44             foundEn = YES;
    45         }
    46     }
    47     XCTAssertTrue(foundEn);
    48 }
    49 
    50 @end