<commit_before>//
//  RequestGetMeTest.swift
//  sugarcrmcandybar
//
//  Created by <NAME> on 06/11/2016.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import XCTest
@testable import sugarcrmcandybar

class RequestGetMeTest: XCTestCase {

    var testData: Data!

    override func setUp() {

        super.setUp()

        if let file = Bundle(for:RequestGetMeTest.self).path(forResource: "GetMe", ofType: "json") {
            self.testData = try? Data(contentsOf: URL(fileURLWithPath: file))
        } else {
            XCTFail("Can't find the test JSON file")
        }
    }

    override func tearDown() {
        super.tearDown()
    }

    func testGetHttpRequestBuildsUrlRequest() {
        class MockSugarCrmInstance: SugarCrmInstance {
            override func getRestUrl() -> String {
                return "http://crm.example.com"
            }
        }
        let crmInstance: SugarCrmInstance = MockSugarCrmInstance()<commit_msg>Override getPassword so no Keychain is required<commit_after>//
//  RequestGetMeTest.swift
//  sugarcrmcandybar
//
//  Created by <NAME> on 06/11/2016.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import XCTest
@testable import sugarcrmcandybar

class RequestGetMeTest: XCTestCase {

    var testData: Data!

    override func setUp() {

        super.setUp()

        if let file = Bundle(for:RequestGetMeTest.self).path(forResource: "GetMe", ofType: "json") {
            self.testData = try? Data(contentsOf: URL(fileURLWithPath: file))
        } else {
            XCTFail("Can't find the test JSON file")
        }
    }

    override func tearDown() {
        super.tearDown()
    }

    func testGetHttpRequestBuildsUrlRequest() {
        class MockSugarCrmInstance: SugarCrmInstance {
            override func getRestUrl() -> String {
                return "http://crm.example.com"
            }

            override func getPassword() -> String {
                return "<PASSWORD>"
            }
        }
        let crmInstance: SugarCrmInstance = MockSugarCrmInstance()
{'fraction_non_alphanumeric': 0.1053144807411019, 'fraction_numerical': 0.011701608971233545, 'mean_word_length': 2.267515923566879, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 11, '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': '2559944', 'n_tokens_mistral': 649, 'n_tokens_neox': 608, 'n_words': 147}