pEpObjCTests/PepTests.m
author Dirk Zimmermann <dirk@pep-project.org>
Thu, 12 Apr 2018 10:05:06 +0200
changeset 567 b9439926c09f
parent 560 6bf2a4dd111b
child 738 7ac89df4a502
permissions -rw-r--r--
IOSAD-72 isPEPUser error handling
     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)testSessionFinalization {
    26     PEPSession *session = [[PEPSession alloc] init];
    27     session = nil;
    28 }
    29 
    30 - (void)testLanguageList {
    31     PEPSession *session = [[PEPSession alloc] init];
    32     NSError *error = nil;
    33     NSArray<PEPLanguage *> *langs = [session languageListWithError:&error];
    34     XCTAssertNil(error);
    35     XCTAssertGreaterThan(langs.count, 0);
    36     BOOL foundEn = NO;
    37     for (PEPLanguage *lang in langs) {
    38         if ([lang.code isEqualToString:@"en"]) {
    39             foundEn = YES;
    40         }
    41     }
    42     XCTAssertTrue(foundEn);
    43 }
    44 
    45 @end