# test-common

Shared test fixtures, builders, and assertions for the Foxhunt workspace. Consolidates duplicate test code across 39+ files.

## Key Types

- `TestDb` -- isolated test database with automatic cleanup
- `MockOrderBuilder` -- fluent order/trade builder
- `BarBuilder` -- OHLCV bar generation with realistic price movements
- `PositionBuilder` -- mock positions with P&L calculations

## Fixtures

- `generate_ohlcv_bars()` -- realistic OHLCV data
- `generate_random_walk()` -- Monte Carlo price simulations
- `generate_crisis_returns()` -- 2008 crisis patterns
- `generate_order_book()` -- order book levels

## Assertions

- `assert_approx_eq!` -- percentage tolerance comparison
- `assert_ohlc_valid` -- OHLC bar validation
- `assert_var_exceedances` -- VaR exceedance checks

## Usage

```toml
[dev-dependencies]
test_common = { path = "../../testing/test-common" }
```
