test: assert causal TWAP entitlement and unfilled remainder

This commit is contained in:
boris
2026-09-11 17:11:53 +08:00
parent 2445dc925a
commit a00dea58b2
@@ -3080,23 +3080,24 @@ fn broker_executes_algo_twap_percent_across_window_quotes() {
) )
.expect("broker execution"); .expect("broker execution");
assert_eq!(report.fill_events.len(), 3); assert_eq!(report.fill_events.len(), 2);
assert_eq!( assert_eq!(
report report
.fill_events .fill_events
.iter() .iter()
.map(|fill| fill.quantity) .map(|fill| fill.quantity)
.sum::<u32>(), .sum::<u32>(),
300 200
); );
assert!(report.fill_events.iter().all(|fill| fill.quantity == 100)); assert!(report.fill_events.iter().all(|fill| fill.quantity == 100));
assert!(report.fill_events.iter().all(|fill| fill.execution_timestamp.is_some_and(|at| at >= date.and_hms_opt(10, 15, 0).unwrap())));
assert_eq!( assert_eq!(
report report
.process_events .process_events
.iter() .iter()
.filter(|event| event.kind == ProcessEventKind::Trade) .filter(|event| event.kind == ProcessEventKind::Trade)
.count(), .count(),
3 2
); );
} }