pEpForiOSTests/MimeTests.swift
author Xavier Algarra <xavier@pep-project.org>
Tue, 06 Jun 2017 07:49:23 +0200
changeset 2248 75013a586bfd
parent 1870 75eb5ac1e7b0
child 2266 fd5e5a23d62d
permissions -rw-r--r--
IOS-137 add multiple accounts option with the new login
     1 //
     2 //  MimeTests.swift
     3 //  pEpForiOS
     4 //
     5 //  Created by Dirk Zimmermann on 29/07/16.
     6 //  Copyright © 2016 p≡p Security S.A. All rights reserved.
     7 //
     8 
     9 import XCTest
    10 
    11 class MimeTests: XCTestCase {
    12 
    13     func testPGPMimePantomime() {
    14         guard let data = TestUtil.loadDataWithFileName("PGPMimeMail.txt") else {
    15             XCTAssertTrue(false)
    16             return
    17         }
    18         let message = CWMessage.init(data: data)
    19         let content = message.content()
    20         guard let multi = content as? CWMIMEMultipart  else {
    21             XCTAssertTrue(false)
    22             return
    23         }
    24         for i in 0..<multi.count() {
    25             let part = multi.part(at: i)
    26             let content = part.content()
    27             if let _ = content as? Data {
    28                 // data
    29             } else if let _ = content as? NSString {
    30                 // string
    31             } else {
    32                 // multi?
    33             }
    34         }
    35     }
    36 }