bot_engine/testing/mod.rs
1//! Testing infrastructure: Mock exchanges, paper trading, and simulation utilities.
2//!
3//! This module provides reusable components for testing and paper trading:
4//! - `QuoteSource`: Trait for quote data providers (mock, live, CSV)
5//! - `FillSimulator`: Shared fill matching logic (price crossing detection)
6//! - `MockExchange`: Manual quote/fill injection for unit tests
7//! - `PaperExchange`: Live quotes with simulated fills for paper trading
8//! - `MockAccountSyncer`, `MockTradeSyncer`: Mock syncers for testing (native only)
9
10// Core testing modules (always available)
11pub mod fill_simulator;
12pub mod mock_exchange;
13pub mod paper_exchange;
14pub mod quote_source;
15
16// Native-only testing modules (require sync_traits)
17#[cfg(feature = "native")]
18pub mod mock_syncer;
19
20// Re-export core types (always available)
21pub use fill_simulator::{FillSimulator, PendingOrder, SimulatedFill};
22pub use mock_exchange::{MockExchange, MockKnobs, OrderFailMode};
23pub use paper_exchange::{
24 create_standalone_paper_exchange, create_standalone_paper_exchange_with_id, ArcExchange,
25 NoOpExchange, PaperExchange, StandalonePaperExchange,
26};
27pub use quote_source::{MockQuoteSource, QuoteSource};
28
29// Re-export native-only mock syncers
30#[cfg(feature = "native")]
31pub use mock_syncer::{MockAccountSyncer, MockTradeSyncer};