#[cfg(test)]
#[allow(clippy::expect_used)]
pub(crate) mod helpers {
use chrono::{DateTime, TimeZone, Utc};
use quant_primitives::Candle;
use rust_decimal::Decimal;
pub fn make_candle(close: Decimal, ts: DateTime<Utc>) -> Candle {
Candle::new(close, close, close, close, Decimal::from(1000), ts)
.expect("BUG in make_candle: flat candle with equal OHLC must always be valid")
}
pub fn ts(idx: i64) -> DateTime<Utc> {
Utc.with_ymd_and_hms(2024, 1, 1, 0, 0, 0)
.single()
.expect("BUG: hardcoded UTC datetime 2024-01-01T00:00:00 is always valid")
+ chrono::Duration::hours(idx)
}
}