diff --git a/crates/wickra-core/src/indicators/chaikin_volatility.rs b/crates/wickra-core/src/indicators/chaikin_volatility.rs index 0a0cc1b8..0ca8b84d 100644 --- a/crates/wickra-core/src/indicators/chaikin_volatility.rs +++ b/crates/wickra-core/src/indicators/chaikin_volatility.rs @@ -189,6 +189,15 @@ mod tests { assert!(ChaikinVolatility::new(10, 0).is_err()); } + /// Cover the const accessor `periods` (69-71) and the Indicator-impl + /// `name` body (99-101). `warmup_period` is exercised elsewhere. + #[test] + fn accessors_and_metadata() { + let cv = ChaikinVolatility::new(10, 10).unwrap(); + assert_eq!(cv.periods(), (10, 10)); + assert_eq!(cv.name(), "ChaikinVolatility"); + } + #[test] fn reset_clears_state() { let candles: Vec = (0..40) diff --git a/crates/wickra-core/src/indicators/chande_kroll_stop.rs b/crates/wickra-core/src/indicators/chande_kroll_stop.rs index e18739f9..813885a4 100644 --- a/crates/wickra-core/src/indicators/chande_kroll_stop.rs +++ b/crates/wickra-core/src/indicators/chande_kroll_stop.rs @@ -214,6 +214,18 @@ mod tests { assert!(ChandeKrollStop::new(10, f64::NAN, 9).is_err()); } + /// Cover the const accessor `params` (97-99) and the Indicator-impl + /// `name` body (164-166). `warmup_period` is exercised elsewhere. + #[test] + fn accessors_and_metadata() { + let s = ChandeKrollStop::new(10, 1.0, 9).unwrap(); + let (p, m, q) = s.params(); + assert_eq!(p, 10); + assert!((m - 1.0).abs() < 1e-12); + assert_eq!(q, 9); + assert_eq!(s.name(), "ChandeKrollStop"); + } + #[test] fn reset_clears_state() { let candles: Vec = (0..40) diff --git a/crates/wickra-core/src/indicators/chandelier_exit.rs b/crates/wickra-core/src/indicators/chandelier_exit.rs index a734ef5c..c79841cd 100644 --- a/crates/wickra-core/src/indicators/chandelier_exit.rs +++ b/crates/wickra-core/src/indicators/chandelier_exit.rs @@ -197,6 +197,17 @@ mod tests { assert!(ChandelierExit::new(22, f64::NAN).is_err()); } + /// Cover the const accessor `params` (83-85) and the Indicator-impl + /// `name` body (128-130). `warmup_period` is exercised elsewhere. + #[test] + fn accessors_and_metadata() { + let ce = ChandelierExit::new(22, 3.0).unwrap(); + let (p, m) = ce.params(); + assert_eq!(p, 22); + assert!((m - 3.0).abs() < 1e-12); + assert_eq!(ce.name(), "ChandelierExit"); + } + #[test] fn reset_clears_state() { let candles: Vec = (0..40) diff --git a/crates/wickra-core/src/indicators/choppiness_index.rs b/crates/wickra-core/src/indicators/choppiness_index.rs index 1b3aa91a..e5f9c0b5 100644 --- a/crates/wickra-core/src/indicators/choppiness_index.rs +++ b/crates/wickra-core/src/indicators/choppiness_index.rs @@ -191,6 +191,15 @@ mod tests { assert!(ChoppinessIndex::new(2).is_ok()); } + /// Cover the const accessor `period` (73-75) and the Indicator-impl + /// `name` body (125-127). `warmup_period` is exercised elsewhere. + #[test] + fn accessors_and_metadata() { + let ci = ChoppinessIndex::new(14).unwrap(); + assert_eq!(ci.period(), 14); + assert_eq!(ci.name(), "ChoppinessIndex"); + } + #[test] fn reset_clears_state() { let candles: Vec = (0..20).map(|i| c(11.0, 9.0, 10.0, i)).collect(); diff --git a/crates/wickra-core/src/indicators/force_index.rs b/crates/wickra-core/src/indicators/force_index.rs index 55b5b5ec..d47874e6 100644 --- a/crates/wickra-core/src/indicators/force_index.rs +++ b/crates/wickra-core/src/indicators/force_index.rs @@ -160,6 +160,15 @@ mod tests { assert!(ForceIndex::new(0).is_err()); } + /// Cover the const accessor `period` (58-60) and the Indicator-impl + /// `name` body (93-95). `warmup_period` is exercised elsewhere. + #[test] + fn accessors_and_metadata() { + let fi = ForceIndex::new(13).unwrap(); + assert_eq!(fi.period(), 13); + assert_eq!(fi.name(), "ForceIndex"); + } + #[test] fn reset_clears_state() { let candles: Vec = (0..30).map(|i| c(10.0 + i as f64, 50.0, i)).collect();