#[test]
fn dust_impact_ejecta() {
    let d = titanss::environment::dust::DustEnvironment::impact_ejecta();
    assert!(d.lofting_probability > 0.0);
    assert!(d.adhesion_risk(100.0) > 0.0);
}

#[test]
fn dust_settled_lower() {
    let e = titanss::environment::dust::DustEnvironment::impact_ejecta();
    let s = titanss::environment::dust::DustEnvironment::settled_regolith();
    assert!(s.adhesion_risk(0.0) < e.adhesion_risk(0.0));
}

#[test]
fn radiation_nominal() {
    let r = titanss::environment::radiation::RadiationEnvironment::nominal_surface();
    assert!(r.effective_daily_dose_msv() > 0.0);
}

#[test]
fn radiation_sheltered_lower() {
    let nom = titanss::environment::radiation::RadiationEnvironment::nominal_surface();
    let shel = titanss::environment::radiation::RadiationEnvironment::sheltered(2.0);
    assert!(shel.effective_daily_dose_msv() < nom.effective_daily_dose_msv());
}

#[test]
fn annual_dose() {
    let r = titanss::environment::radiation::RadiationEnvironment::nominal_surface();
    assert!(titanss::environment::radiation::annual_crew_dose_msv(r) > 0.0);
}

#[test]
fn thermal_in_range() {
    let t = titanss::environment::thermal::ThermalEnvironment {
        local_time_hours: 382.7 * 0.5,
        latitude_deg: 0.0,
        shadowed: false,
    };
    let temp = t.surface_temperature_k();
    assert!((72.0..=94.0).contains(&temp));
}

#[test]
fn shadow_reduces_temp() {
    let lit = titanss::environment::thermal::ThermalEnvironment {
        local_time_hours: 382.7 * 0.5,
        latitude_deg: 0.0,
        shadowed: false,
    };
    let dark = titanss::environment::thermal::ThermalEnvironment {
        local_time_hours: 382.7 * 0.5,
        latitude_deg: 0.0,
        shadowed: true,
    };
    assert!(dark.surface_temperature_k() <= lit.surface_temperature_k());
}

#[test]
fn thermal_cycle_span() {
    assert!(titanss::environment::thermal::thermal_cycle_span_k(0.0) > 0.0);
}
