lambdust 0.1.1

A Scheme dialect with gradual typing and effect systems
use super::{
    DIContainer, MockContinuationRepository, MockRepositoryBehavior, 
    MockEffectInterpreter, MockEffectBehavior, MockConfiguration, TestFixture
};
use std::collections::HashMap;

/// Test fixture builder for setting up test scenarios
#[derive(Debug)]
pub struct TestFixtureBuilder {
    /// DI container being built
    container: DIContainer,
    
    /// Mock configurations
    mock_configs: HashMap<String, MockConfiguration>,
}

impl Default for TestFixtureBuilder {
    fn default() -> Self {
        Self::new()
    }
}

impl TestFixtureBuilder {
    /// Create a new test fixture builder
    pub fn new() -> Self {
        Self {
            container: DIContainer::new(),
            mock_configs: HashMap::new(),
        }
    }
    
    /// Add a mock continuation repository
    pub fn with_mock_continuation_repository(mut self, behavior: MockRepositoryBehavior) -> Self {
        let mock_repo = MockContinuationRepository::with_behavior(behavior.clone());
        // Note: Mock repository disabled due to Send trait requirements
        // In a production system, we would use Arc<ThreadSafeEnvironment> throughout
        // self.container.register("continuation_repository", mock_repo);
        self.mock_configs.insert("continuation_repository".to_string(), MockConfiguration::Repository(behavior));
        self
    }
    
    /// Add a mock effect interpreter
    pub fn with_mock_effect_interpreter(mut self, behavior: MockEffectBehavior) -> Self {
        let mock_interpreter = MockEffectInterpreter::new();
        self.container.register("effect_interpreter", mock_interpreter);
        self.mock_configs.insert("effect_interpreter".to_string(), MockConfiguration::EffectInterpreter(behavior));
        self
    }
    
    /// Build the test fixture
    pub fn build(self) -> TestFixture {
        TestFixture {
            container: self.container,
            mock_configs: self.mock_configs,
        }
    }
}