pEpForiOSTests/FlagImageTests.swift
author Xavier Algarra <xavier@pep-project.org>
Tue, 06 Jun 2017 07:49:23 +0200
changeset 2248 75013a586bfd
parent 1932 d709d0b06135
child 2838 5210d224f53c
permissions -rw-r--r--
IOS-137 add multiple accounts option with the new login
     1 //
     2 //  FlagImageTests.swift
     3 //  pEpForiOS
     4 //
     5 //  Created by Dirk Zimmermann on 02/02/2017.
     6 //  Copyright © 2017 p≡p Security S.A. All rights reserved.
     7 //
     8 
     9 import XCTest
    10 import UIKit
    11 
    12 import pEpForiOS
    13 import MessageModel
    14 
    15 class FlagImageTests: XCTestCase {
    16     
    17     func testSimple() {
    18         let fi = FlagImages.create(imageSize: CGSize(width: 16, height: 16))
    19 
    20         XCTAssertNotNil(fi.notSeenImage)
    21         XCTAssertNotNil(fi.flaggedImage)
    22         XCTAssertNotNil(fi.flaggedAndNotSeenImage)
    23 
    24         let msg = Message.create(uuid: MessageID.generate())
    25 
    26         msg.imapFlags?.seen = true
    27         XCTAssertNil(fi.flagsImage(message: msg))
    28 
    29         msg.imapFlags?.flagged = true
    30         XCTAssertEqual(fi.flagsImage(message: msg), fi.flaggedImage)
    31 
    32         msg.imapFlags?.seen = false
    33         XCTAssertEqual(fi.flagsImage(message: msg), fi.flaggedImage)
    34 
    35         msg.imapFlags?.flagged = false
    36         XCTAssertNil(fi.flagsImage(message: msg))
    37     }
    38 }