<commit_before>import XCTest

class TMHomeStrategy:XCTestCase
{
    
}
<commit_msg>Test refresh strategy<commit_after>import XCTest
@testable import gattaca

class TMHomeStrategy:XCTestCase
{
    private var session:MSession?
    private var controller:CHome?
    private var strategy:MHomeStrategy?
    
    override func setUp()
    {
        super.setUp()
        
        let session:MSession = MSession(
            status:MSession.Status.new)
        self.session = session
        
        let controller:CHome = CHome(session:session)
        self.controller = controller
        
        strategy = MHomeStrategyNew(controller:controller)
    }
    
    //MARK: internal
    
    func testInit()
    {
        XCTAssertNotNil(
            strategy,
            "failed init strategy")
    }
    
    func testRefreshStrategy()
    {
        guard
        
            let session:MSession = self.session,
            let strategy:MHomeStrategy = self.strategy
        
        else
        {
            return
        }
        
        session.status = MSession.Status.ready
        strategy.refreshStrategy()
        
        let newStrategy:MHomeStrategyReady? = controller?.model.strategy as? MHomeStrategyReady
        
        XCTAssertNotNil(
            newStrategy,
            "failed refreshing strategy")
    }
}

{'fraction_non_alphanumeric': 0.06741573033707865, 'fraction_numerical': 0.0, 'mean_word_length': 1.8067226890756303, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4885987', 'n_tokens_mistral': 361, 'n_tokens_neox': 360, 'n_words': 72}