<commit_before>//
//  KeyboardHideManagerTests.swift
//  KeyboardHideManagerTests
//
//  Created by <NAME> on 05.12.16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import XCTest
@testable import KeyboardHideManager

class KeyboardHideManagerTests: XCTestCase {
    
    let keyboardHideManager = KeyboardHideManager()
    
    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 testAddGesture() {
        let view = UIView()
        
        keyboardHideManager.addGesture(to: view)
        
        XCTAssert(view.gestureRecognizers != nil, "view.gestureRecognizers == nil")
        XCTAssert(view.gestureRecognizers!.count == 1, "view.gestureRecognizers!.count != 1")
    }
    
    func testAddTargets() {
        let views = [UIView(), UIView()]
        
        keyboardHideManager.targets = views
        
        for target in keyboardHideManager.targets {
            XCTAssert(target.gestureRecognizers != nil, "target.gestureRecognizers == nil")
            XCTAssert(target.gestureRecognizers!.count == 1, "target.gestureRecognizers!.count != 1")
        }
    }
    
    func testTopSuperview() {
        let view = UIView()
        
        XCTAssert(view.topSuperview == nil, "view.topSuperview != nil")
    }
    
    func testTopSuperview2() {
        let view1 = UIView()
        let view2 = UIView()
        let view3 = UIView()
        view2.addSubview(view3)
        view1.addSubview(view2)
        
        XCTAssert(view3.topSuperview == view1, "view3.topSuperview != view1")
    }
    
    func testDismissKeyboard() {
        let view = UIView()
        let textField = UITextField()
        view.addSubview(textField)<commit_msg>updated tests<commit_after>//
//  KeyboardHideManagerTests.swift
//  KeyboardHideManagerTests
//
//  Created by <NAME> on 05.12.16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import XCTest
@testable import KeyboardHideManager

class KeyboardHideManagerTests: XCTestCase {
    
    let keyboardHideManager = KeyboardHideManager()
    
    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 testAddGesture() {
        let view = UIView()
        
        keyboardHideManager.addGesture(to: view)
        
        XCTAssert(view.gestureRecognizers != nil, "view.gestureRecognizers == nil")
        XCTAssert(view.gestureRecognizers!.count == 1, "view.gestureRecognizers!.count != 1")
    }
    
    func testAddTargets() {
        let views = [UIView(), UIView()]
        
        keyboardHideManager.targets = views
        
        for target in keyboardHideManager.targets {
            XCTAssert(target.gestureRecognizers != nil, "target.gestureRecognizers == nil")
            XCTAssert(target.gestureRecognizers!.count == 1, "target.gestureRecognizers!.count != 1")
        }
    }

    func testDismissKeyboard() {
        let view = UIView()
        let textField = UITextField()
        view.addSubview(textField)
{'fraction_non_alphanumeric': 0.09822958309537407, 'fraction_numerical': 0.011422044545973729, 'mean_word_length': 2.342557251908397, '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': '3951609', 'n_tokens_mistral': 1071, 'n_tokens_neox': 1012, 'n_words': 254}