use rmcp::handler::server::ServerHandler;

use super::*;

/// Guardrail: the wire-visible tool list stays exactly the live set —
/// the planned `ownship_status` / `submit_command` capabilities must not
/// be registered before a provider exists.
#[test]
fn wire_visible_tools_are_exactly_the_live_set() {
    let router = AeroContextServer::tool_router();
    let mut names: Vec<String> = router
        .list_all()
        .iter()
        .map(|tool| tool.name.to_string())
        .collect();
    names.sort();
    assert_eq!(
        names,
        [
            "area_brief",
            "navdata_status",
            "navdata_sync",
            "resolve",
            "route_brief"
        ]
    );
}

#[test]
fn server_info_carries_identity_and_capability_map() {
    let info = AeroContextServer::new().get_info();
    assert_eq!(info.server_info.name, "aerocontext");
    assert_eq!(info.server_info.version, env!("CARGO_PKG_VERSION"));
    assert!(info.capabilities.tools.is_some());

    let instructions = info.instructions.unwrap();
    assert!(instructions.contains("ownship_status"));
    assert!(instructions.contains("submit_command"));
    assert!(instructions.contains("advisory"));
    assert!(instructions.contains("raw_text"));
}
