#[test]
fn lod_level_close_is_high() {
    let config = deimoss::terrain::lod::LodConfig::default();
    let level = deimoss::terrain::lod::lod_level(config, 100.0);
    assert!(level >= config.min_level);
}

#[test]
fn lod_level_far_is_low() {
    let config = deimoss::terrain::lod::LodConfig::default();
    let level_far = deimoss::terrain::lod::lod_level(config, 1_000_000.0);
    let level_close = deimoss::terrain::lod::lod_level(config, 100.0);
    assert!(level_far <= level_close);
}

#[test]
fn spherical_patch_vertex_count() {
    let p = deimoss::terrain::mesh::SphericalPatch::new(16);
    assert_eq!(p.vertex_count(), 17 * 17);
}

#[test]
fn spherical_patch_triangle_count() {
    let p = deimoss::terrain::mesh::SphericalPatch::new(8);
    assert_eq!(p.triangle_count(), 128);
}

#[test]
fn material_from_low_albedo() {
    let m = deimoss::terrain::texturing::material_from_albedo(0.05, false);
    assert_eq!(
        m,
        deimoss::terrain::texturing::TerrainMaterial::DarkRegolith
    );
}

#[test]
fn material_from_mid_albedo() {
    let m = deimoss::terrain::texturing::material_from_albedo(0.07, false);
    assert_eq!(
        m,
        deimoss::terrain::texturing::TerrainMaterial::SmoothPlains
    );
}

#[test]
fn impact_melt_terrain() {
    let m = deimoss::terrain::texturing::material_from_albedo(0.09, true);
    assert_eq!(m, deimoss::terrain::texturing::TerrainMaterial::ImpactMelt);
}
