use darkmatter::detection::spectra::{
antiproton_spectrum_bb, antiproton_spectrum_ww, branching_ratio_weighted_spectrum,
differential_flux_decay, differential_flux_gamma, dn_dgamma_bb, dn_dgamma_mumu,
dn_dgamma_tautau, dn_dgamma_ww, integrated_flux_above_threshold, neutrino_spectrum_bb,
neutrino_spectrum_tautau, positron_spectrum_bb, positron_spectrum_tautau,
total_photon_yield_bb, total_photon_yield_tautau,
};
#[test]
fn photon_channels_positive() {
let m = 100.0;
let e = 10.0;
assert!(dn_dgamma_bb(e, m) >= 0.0);
assert!(dn_dgamma_tautau(e, m) >= 0.0);
assert!(dn_dgamma_ww(e, m) >= 0.0);
assert!(dn_dgamma_mumu(e, m) >= 0.0);
}
#[test]
fn zero_above_mass() {
let m = 100.0;
assert_eq!(dn_dgamma_bb(200.0, m), 0.0);
assert_eq!(dn_dgamma_tautau(200.0, m), 0.0);
}
#[test]
fn positron_positive() {
assert!(positron_spectrum_bb(5.0, 100.0) >= 0.0);
assert!(positron_spectrum_tautau(5.0, 100.0) >= 0.0);
}
#[test]
fn antiproton_positive() {
assert!(antiproton_spectrum_bb(5.0, 100.0) >= 0.0);
assert!(antiproton_spectrum_ww(5.0, 100.0) >= 0.0);
}
#[test]
fn neutrino_positive() {
assert!(neutrino_spectrum_bb(5.0, 100.0) >= 0.0);
assert!(neutrino_spectrum_tautau(5.0, 100.0) >= 0.0);
}
#[test]
fn total_photon_yield() {
let y_bb = total_photon_yield_bb(100.0, 1000);
let y_tau = total_photon_yield_tautau(100.0, 1000);
assert!(y_bb > 0.0);
assert!(y_tau > 0.0);
}
#[test]
fn differential_flux_gamma_positive() {
let dn_de = dn_dgamma_bb(10.0, 100.0);
let flux = differential_flux_gamma(dn_de, 3e-26, 1e20, 100.0);
assert!(flux >= 0.0);
}
#[test]
fn differential_flux_decay_positive() {
let dn_de = dn_dgamma_bb(10.0, 100.0);
let flux = differential_flux_decay(dn_de, 1e-28, 1e18, 100.0);
assert!(flux >= 0.0);
}
#[test]
fn integrated_flux() {
let flux = integrated_flux_above_threshold(100.0, 3e-26, 1e20, 1.0, "bb", 500);
assert!(flux >= 0.0);
}
#[test]
fn branching_ratio_weighted() {
let dn = branching_ratio_weighted_spectrum(10.0, 100.0, 0.5, 0.3, 0.2);
assert!(dn >= 0.0);
}