<commit_before>//
//  AlertsTests.swift
//  AlertsTests
//
//  Created by <NAME> on 8/29/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import XCTest
@testable import Alerts

class AlertsTests: XCTestCase {
    
    override func setUp() {
        super.setUp()
        // Put setup code here. This method is called before the invocation of each test method in the class.
    }
    
    override func tearDown() {
        // Put teardown code here. This method is called after the invocation of each test method in the class.
        super.tearDown()
    }
    
    func testExample() {
        // This is an example of a functional test case.
        // Use XCTAssert and related functions to verify your tests produce the correct results.
    }
    
    func testPerformanceExample() {
        // This is an example of a performance test case.
        self.measure {
            // Put the code you want to measure the time of here.
        }
    }
    
}<commit_msg>Add coordinator unit tests<commit_after>//
//  AlertsTests.swift
//  AlertsTests
//
//  Created by <NAME> on 8/29/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import XCTest
@testable import Alerts

class AlertsTests: XCTestCase {
    
    override func setUp() {
        super.setUp()
        // Put setup code here. This method is called before the invocation of each test method in the class.
        AlertCoordinator.main.reset()
    }
    
    override func tearDown() {
        // Put teardown code here. This method is called after the invocation of each test method in the class.
        super.tearDown()
        AlertCoordinator.main.reset()
    }
    
    func testHighAlertQueue() {
        let alert = Alert(title: "High", message: "Message", priorty: .high, alertActions: nil)
        AlertCoordinator.main.enqueue(alert: alert)
        XCTAssertEqual(AlertCoordinator.main.highPriorityQueue.count, 1)
        XCTAssertEqual(AlertCoordinator.main.defaultPriorityQueue.count, 0)
        XCTAssertEqual(AlertCoordinator.main.lowPriorityQueue.count, 0)
    }
    
    func testDefaultAlertQueue() {
        let alert = Alert(title: "Default", message: "Message", priorty: .medium, alertActions: nil)
        AlertCoordinator.main.enqueue(alert: alert)
        XCTAssertEqual(AlertCoordinator.main.highPriorityQueue.count, 0)
        XCTAssertEqual(AlertCoordinator.main.defaultPriorityQueue.count, 1)
        XCTAssertEqual(AlertCoordinator.main.lowPriorityQueue.count, 0)
    }
    
    func testLowAlertQueue() {
        let alert = Alert(title: "Low", message: "Message", priorty: .low, alertActions: nil)
        AlertCoordinator.main.enqueue(alert: alert)
        XCTAssertEqual(AlertCoordinator.main.highPriorityQueue.count, 0)
        XCTAssertEqual(AlertCoordinator.main.defaultPriorityQueue.count, 0)
        XCTAssertEqual(AlertCoordinator.main.lowPriorityQueue.count, 1)
    }
    
    func testResetOfAlertCoordinator() {
        let alert = Alert(title: "Default", message: "Message", priorty: .medium, alertActions: nil)
        AlertCoordinator.main.enqueue(alert: alert)
        XCTAssertEqual(AlertCoordinator.main.defaultPriorityQueue.count, 1)
        AlertCoordinator.main.reset()
        XCTAssertEqual(AlertCoordinator.main.highPriorityQueue.count, 0)
        XCTAssertEqual(AlertCoordinator.main.defaultPriorityQueue.count, 0)
        XCTAssertEqual(AlertCoordinator.main.lowPriorityQueue.count, 0)
    }
}
{'fraction_non_alphanumeric': 0.09239288837073739, 'fraction_numerical': 0.009035266686097347, 'mean_word_length': 2.8006644518272426, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2107876', 'n_tokens_mistral': 1025, 'n_tokens_neox': 977, 'n_words': 269}