<commit_before>//
//  HTTPStatusCodesTests.swift
//  HTTPStatusCodesTests
//
//  Created by <NAME> on 22/02/2015.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import Foundation
import XCTest

@testable import HTTPStatusCodes

private func response(statusCode: Int) -> NSHTTPURLResponse {
    return NSHTTPURLResponse(URL: NSURL(string: "http://www.google.com")!, statusCode: statusCode, HTTPVersion: nil, headerFields: nil)!
}
private func response(statusCode: HTTPStatusCode) -> NSHTTPURLResponse {
    return NSHTTPURLResponse(URL: NSURL(string: "http://www.google.com")!, statusCode: statusCode, HTTPVersion: nil, headerFields: nil)!
}

class HTTPStatusCodesTests: XCTestCase {
    
    func testNSHTTPURLResponseInit() {
        XCTAssertEqual(response(.Continue).statusCode, 100, "Incorrect status code")
        XCTAssertEqual(response(.OK).statusCode, 200, "Incorrect status code")
        XCTAssertEqual(response(.MultipleChoices).statusCode, 300, "Incorrect status code")
        XCTAssertEqual(response(.BadRequest).statusCode, 400, "Incorrect status code")
        XCTAssertEqual(response(.InternalServerError).statusCode, 500, "Incorrect status code")
    }
    
    func testComputedStatusCodeValueProperty() {
        XCTAssertEqual(response(100).statusCodeValue!, HTTPStatusCode.Continue, "Incorrect status code")
        XCTAssertEqual(response(200).statusCodeValue!, HTTPStatusCode.OK, "Incorrect status code")
        XCTAssertEqual(response(300).statusCodeValue!, HTTPStatusCode.MultipleChoices, "Incorrect status code")
        XCTAssertEqual(response(400).statusCodeValue!, HTTPStatusCode.BadRequest, "Incorrect status code")
        XCTAssertEqual(response(500).statusCodeValue!, HTTPStatusCode.InternalServerError, "Incorrect status code")<commit_msg>Tests for objective-c status code enum property<commit_after>//
//  HTTPStatusCodesTests.swift
//  HTTPStatusCodesTests
//
//  Created by <NAME> on 22/02/2015.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import Foundation
import XCTest

@testable import HTTPStatusCodes

private func response(statusCode: Int) -> NSHTTPURLResponse {
    return NSHTTPURLResponse(URL: NSURL(string: "http://www.google.com")!, statusCode: statusCode, HTTPVersion: nil, headerFields: nil)!
}
private func response(statusCode: HTTPStatusCode) -> NSHTTPURLResponse {
    return NSHTTPURLResponse(URL: NSURL(string: "http://www.google.com")!, statusCode: statusCode, HTTPVersion: nil, headerFields: nil)!
}

class HTTPStatusCodesTests: XCTestCase {
    
    func testNSHTTPURLResponseInit() {
        XCTAssertEqual(response(.Continue).statusCode, 100, "Incorrect status code")
        XCTAssertEqual(response(.OK).statusCode, 200, "Incorrect status code")
        XCTAssertEqual(response(.MultipleChoices).statusCode, 300, "Incorrect status code")
        XCTAssertEqual(response(.BadRequest).statusCode, 400, "Incorrect status code")
        XCTAssertEqual(response(.InternalServerError).statusCode, 500, "Incorrect status code")
    }
    
    func testComputedStatusCodeValueProperty() {
        XCTAssertEqual(response(100).statusCodeValue!, HTTPStatusCode.Continue, "Incorrect status code")
        XCTAssertEqual(response(200).statusCodeValue!, HTTPStatusCode.OK, "Incorrect status code")
        XCTAssertEqual(response(300).statusCodeValue!, HTTPStatusCode.MultipleChoices, "Incorrect status code")
        XCTAssertEqual(response(400).statusCodeValue!, HTTPStatusCode.BadRequest, "Incorrect status code")
        XCTAssertEqual(response(500).statusCodeValue!, HTTPStatusCode.InternalServerError, "Incorrect status code")
    }
    
    func testComputedStatusCodeEnumProperty() {
        XCTAssertEqual(response(100).statusCodeEnum, HTTPStatusCode.Continue, "Incorrect status code")
        XCTAssertEqual(response(200).statusCodeEnum, HTTPStatusCode.OK, "Incorrect status code")
        XCTAssertEqual(response(300).statusCodeEnum, HTTPStatusCode.MultipleChoices, "Incorrect status code")
        XCTAssertEqual(response(400).statusCodeEnum, HTTPStatusCode.BadRequest, "Incorrect status code")
        XCTAssertEqual(response(500).statusCodeEnum, HTTPStatusCode.InternalServerError, "Incorrect status code")
{'fraction_non_alphanumeric': 0.10854007633587787, 'fraction_numerical': 0.02361641221374046, 'mean_word_length': 5.130116959064328, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '931147', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1173, 'n_words': 250}