// Tests for mecha10_cli::services::deployment

use mecha10_cli::services::deployment::*;

#[test]
fn test_deploy_strategy_parsing() {
    assert_eq!("direct".parse::<DeployStrategy>(), Ok(DeployStrategy::Direct));
    assert_eq!("canary".parse::<DeployStrategy>(), Ok(DeployStrategy::Canary));
    assert_eq!("rolling".parse::<DeployStrategy>(), Ok(DeployStrategy::Rolling));
    assert_eq!("blue-green".parse::<DeployStrategy>(), Ok(DeployStrategy::BlueGreen));
    assert!("invalid".parse::<DeployStrategy>().is_err());
}

#[test]
fn test_deploy_strategy_as_str() {
    assert_eq!(DeployStrategy::Direct.as_str(), "direct");
    assert_eq!(DeployStrategy::Canary.as_str(), "canary");
    assert_eq!(DeployStrategy::Rolling.as_str(), "rolling");
    assert_eq!(DeployStrategy::BlueGreen.as_str(), "blue-green");
}

#[test]
fn test_default_config() {
    let config = DeployConfig::default();
    assert_eq!(config.host, "robot.local");
    assert_eq!(config.user, "mecha10");
    assert_eq!(config.port, 22);
    assert_eq!(config.remote_dir, "/opt/mecha10");
    assert_eq!(config.health_check_timeout, 30);
    assert_eq!(config.health_check_retries, 3);
}

#[test]
fn test_new_service() {
    let service = DeploymentService::new();
    // Service is stateless, just verify creation
    let _ = service;
}
