You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.1 KiB

  1. //
  2. // PepTests.m
  3. // pEpiOSAdapter
  4. //
  5. // Created by Dirk Zimmermann on 01/08/16.
  6. // Copyright © 2016 pp. All rights reserved.
  7. //
  8. #import <XCTest/XCTest.h>
  9. #import "PEPObjCAdapter.h"
  10. #import "PEPInternalSession.h"
  11. #import "PEPSessionProvider.h"
  12. #import "PEPLanguage.h"
  13. #import "PEPSession.h"
  14. @interface PepTests : XCTestCase
  15. @end
  16. @implementation PepTests
  17. - (void)setUp {
  18. [super setUp];
  19. [PEPObjCAdapter setupTrustWordsDB:[NSBundle bundleForClass:[self class]]];
  20. }
  21. - (void)tearDown
  22. {
  23. [PEPSession cleanup];
  24. }
  25. - (void)testSessionFinalization {
  26. PEPSession *session = [[PEPSession alloc] init];
  27. session = nil;
  28. }
  29. - (void)testLanguageList {
  30. PEPInternalSession *session = [PEPSessionProvider session];
  31. NSError *error = nil;
  32. NSArray<PEPLanguage *> *langs = [session languageListWithError:&error];
  33. XCTAssertNil(error);
  34. XCTAssertGreaterThan(langs.count, 0);
  35. BOOL foundEn = NO;
  36. for (PEPLanguage *lang in langs) {
  37. if ([lang.code isEqualToString:@"en"]) {
  38. foundEn = YES;
  39. }
  40. }
  41. XCTAssertTrue(foundEn);
  42. }
  43. @end