use moons::observation::communications::earth_direct_to_home;
use moons::observation::earth_view::{EarthView, earthshine_gain};
use moons::observation::navigation::NavigationSolution;
fn ensure_earth_context() {
let earth_context = moons::interactions::earths::ensure_earths_binary_or_simulate();
assert!(earth_context.surface_speed_m_s > 400.0);
}
#[test]
fn near_side_earth_is_visible() {
ensure_earth_context();
let view = EarthView::near_side_default();
assert!(view.is_visible());
assert!(earthshine_gain(view, 0.12) > 0.0);
}
#[test]
fn direct_link_budget_has_negative_margin_without_big_gain() {
ensure_earth_context();
let link = earth_direct_to_home();
assert!(link.received_margin_db(20.0) < 0.0);
}
#[test]
fn autonomous_navigation_is_robust() {
ensure_earth_context();
assert!(NavigationSolution::autonomous_surface_fix().is_robust());
}