//! Unit tests for the SteamCMD module.
//!
//! Tests cover app ID resolution for all four supported games, including the
//! platform-specific Soulmask split, and verify that Dune correctly returns
//! `None` (it uses Docker images, not SteamCMD).

use corrosion_host_agent::steamcmd::app_id_for_game;

#[test]
fn rust_has_correct_app_id() {
    assert_eq!(app_id_for_game("rust"), Some(258550));
}

#[test]
fn conan_has_correct_app_id() {
    assert_eq!(app_id_for_game("conan"), Some(443030));
}

/// Soulmask returns the Windows server app ID on Windows builds, the Linux
/// dedicated server app ID on all other targets.
#[test]
#[cfg(windows)]
fn soulmask_windows_app_id() {
    assert_eq!(app_id_for_game("soulmask"), Some(3017310));
}

#[test]
#[cfg(not(windows))]
fn soulmask_linux_app_id() {
    assert_eq!(app_id_for_game("soulmask"), Some(3017300));
}

/// Dune uses Docker images — SteamCMD integration is explicitly unsupported.
#[test]
fn dune_has_no_app_id() {
    assert_eq!(app_id_for_game("dune"), None);
}

/// Unknown games also produce None; callers should treat this the same as
/// Dune (no SteamCMD support).
#[test]
fn unknown_game_returns_none() {
    assert_eq!(app_id_for_game("minecraft"), None);
    assert_eq!(app_id_for_game(""), None);
}
