<commit_before>//
//  This is an example of testing alert view functionality.
//
//  Created by <NAME> on 18/03/2015.
//  Copyright (c) 2015 The Exchange Group Pty Ltd. All rights reserved.
//

import UIKit
import XCTest
import AlertViewWithCallback

class AlertViewWithCallbackTests: XCTestCase {
  
  func testShowAlert() {
    let alertMock = AlertViewWithCallbackMock()
    
    ViewController.showAlert(alertMock) { name, buttonCaption in }
    
    // Verify alert title
    // ------------------------------
    
    XCTAssertEqual("Enter your name", alertMock.testAlertView!.title)
    
    // Verify alert buttons
    // ------------------------------
    
    XCTAssertEqual(2, alertMock.testAlertView!.numberOfButtons)
    XCTAssertEqual("OK", alertMock.testAlertView!.buttonTitleAtIndex(0))
    XCTAssertEqual("Cancel", alertMock.testAlertView!.buttonTitleAtIndex(1))
  }
  
  func testShowAlert_returnNameAndButtonCaption() {
    let alertMock = AlertViewWithCallbackMock()
    
    var resultName: String?
    var resultButtonCaption: String?
    
    ViewController.showAlert(alertMock) { name, buttonCaption in
      resultName = name
      resultButtonCaption = buttonCaption
    }
    
    // Simulate entering text into alert
    alertMock.testAlertView!.textFieldAtIndex(0)!.text = "Gunter"
    alertMock.tapButton("OK")
    
    
    // Check the returned values
    // ------------------------------
    
    XCTAssertEqual("Gunter", resultName!)
    XCTAssertEqual("OK", resultButtonCaption!)
  }
}<commit_msg>Empty line<commit_after>//
//  This is an example of testing alert view functionality.
//
//  Created by <NAME> on 18/03/2015.
//  Copyright (c) 2015 The Exchange Group Pty Ltd. All rights reserved.
//

import UIKit
import XCTest
import AlertViewWithCallback

class AlertViewWithCallbackTests: XCTestCase {
  
  func testShowAlert() {
    let alertMock = AlertViewWithCallbackMock()
    
    ViewController.showAlert(alertMock) { name, buttonCaption in }
    
    // Verify alert title
    // ------------------------------
    
    XCTAssertEqual("Enter your name", alertMock.testAlertView!.title)
    
    // Verify alert buttons
    // ------------------------------
    
    XCTAssertEqual(2, alertMock.testAlertView!.numberOfButtons)
    XCTAssertEqual("OK", alertMock.testAlertView!.buttonTitleAtIndex(0))
    XCTAssertEqual("Cancel", alertMock.testAlertView!.buttonTitleAtIndex(1))
  }
  
  func testShowAlert_returnNameAndButtonCaption() {
    let alertMock = AlertViewWithCallbackMock()
    
    var resultName: String?
    var resultButtonCaption: String?
    
    ViewController.showAlert(alertMock) { name, buttonCaption in
      resultName = name
      resultButtonCaption = buttonCaption
    }
    
    // Simulate entering text into alert
    alertMock.testAlertView!.textFieldAtIndex(0)!.text = "Gunter"
    alertMock.tapButton("OK")
    
    // Check the returned values
    // ------------------------------
    
    XCTAssertEqual("Gunter", resultName!)
    XCTAssertEqual("OK", resultButtonCaption!)
  }
}
{'fraction_non_alphanumeric': 0.1471550032701112, 'fraction_numerical': 0.010464355788096796, 'mean_word_length': 2.5364161849710984, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7657824', 'n_tokens_mistral': 904, 'n_tokens_neox': 856, 'n_words': 191}