#[test]
fn mars_context_creates() {
    let ctx = deimoss::interactions::marss::ensure_marss_binary_or_simulate();
    assert!(ctx.orbital_radius_km > 200_000_000.0);
}

#[test]
fn submars_bulge_computed() {
    let response = deimoss::physics::tides::TidalResponse::current();
    let bulge = deimoss::interactions::earth_tides::submars_bulge_m(response);
    assert!(bulge.is_finite());
}

#[test]
fn antimars_bulge_computed() {
    let response = deimoss::physics::tides::TidalResponse::current();
    let bulge = deimoss::interactions::earth_tides::antimars_bulge_m(response);
    assert!(bulge.is_finite());
}

#[test]
fn libration_factor_at_zero() {
    let f = deimoss::interactions::orbital_dynamics::libration_factor(0.0);
    assert!((f - 1.0).abs() < 1e-9);
}

#[test]
fn orbital_energy_negative() {
    let orbit = deimoss::physics::orbit::DeimosOrbit::new();
    let e = deimoss::interactions::orbital_dynamics::orbital_energy_j_per_kg(
        orbit,
        orbit.semi_major_axis_m,
    );
    assert!(e < 0.0);
}

#[test]
fn resonance_offset_synchronous() {
    let orbit = deimoss::physics::orbit::DeimosOrbit::new();
    let offset = deimoss::interactions::orbital_dynamics::resonance_offset_deg(
        orbit,
        orbit.orbital_period_s(),
    );
    assert!(offset.abs() < 1e-6);
}
