<commit_before>//
//  UserDefaultsStoreTests.swift
//  StoreKitUserInfo
//
//  Created by <NAME> on 04/05/2017.
//  Copyright © 2017 CocoaPods. All rights reserved.
//

import XCTest
@testable import StoreKitUserInfo

class UserDefaultsStoreTests: XCTestCase {
    
    var store: StoreKitUserInfoStore!
    
    // MARK: Setup
    
    override func setUp() {
        store = UserDefaults(suiteName: name!)!
    }
    
    // MARK: Tests
 
    func testGettingNilValuesWhenEmpty() {
        let key = String.random
        let int: Int? = store.loadUserInfo(forKey: key)
        
        XCTAssertNil(int)
    }
    
    func testSavingIntValues() {
        let int = Int.random
        let key = String.random
        
        store.save(userInfo: int, forKey: key)
        
        let savedInt: Int? = store.loadUserInfo(forKey: key)
        
        XCTAssertEqual(int, savedInt)
    }
    
    func testSavingStringValues() {
        let string = String.random
        let key = String.random
        
        store.save(userInfo: string, forKey: key)
        
        let savedString: String? = store.loadUserInfo(forKey: key)
        
        XCTAssertEqual(string, savedString)
    }
}<commit_msg>Add deletion test for store<commit_after>//
//  UserDefaultsStoreTests.swift
//  StoreKitUserInfo
//
//  Created by <NAME> on 04/05/2017.
//  Copyright © 2017 CocoaPods. All rights reserved.
//

import XCTest
@testable import StoreKitUserInfo

class UserDefaultsStoreTests: XCTestCase {
    
    var store: StoreKitUserInfoStore!
    
    // MARK: Setup
    
    override func setUp() {
        store = UserDefaults(suiteName: name!)!
    }
    
    // MARK: Tests
 
    func testGettingNilValuesWhenEmpty() {
        let key = String.random
        let int: Int? = store.loadUserInfo(forKey: key)
        
        XCTAssertNil(int)
    }
    
    func testSavingIntValues() {
        let int = Int.random
        let key = String.random
        
        store.save(userInfo: int, forKey: key)
        
        let savedInt: Int? = store.loadUserInfo(forKey: key)
        
        XCTAssertEqual(int, savedInt)
    }
    
    func testSavingStringValues() {
        let string = String.random
        let key = String.random
        
        store.save(userInfo: string, forKey: key)
        
        let savedString: String? = store.loadUserInfo(forKey: key)
        
        XCTAssertEqual(string, savedString)
    }
    
    func testDeletion() {
        let string = String.random
        let key = String.random
        
        store.save(userInfo: string, forKey: key)
        
        let savedString: String? = store.loadUserInfo(forKey: key)
        
        XCTAssertEqual(string, savedString)
        
        store.deleteUserInfo(forKey: key)
        
        let savedString2: String? = store.loadUserInfo(forKey: key)
        
        XCTAssertNil(savedString2)
    }
}
{'fraction_non_alphanumeric': 0.08961937716262976, 'fraction_numerical': 0.008996539792387544, 'mean_word_length': 1.9530132788559755, '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': '4880472', 'n_tokens_mistral': 913, 'n_tokens_neox': 869, 'n_words': 201}