//! Simple test to verify core fixes work

#[cfg(test)]
mod tests {
    use crate::*;
// use crate::operations; // Available if needed

    #[test]
    fn test_price_to_cents() {
        let price = Price::from_f64(1.50)?;
        assert_eq!(price.to_cents(), 150);

        let zero_price = Price::ZERO;
        assert_eq!(zero_price.to_cents(), 0);

        let cent_price = Price::CENT;
        assert_eq!(cent_price.to_cents(), 1);
    }

    #[test]
    fn test_price_division() {
        let price = Price::from_f64(10.0)?;
        let halved = price / 2.0;
        assert_eq!(halved.to_f64(), 5.0);
    }

    #[test]
    fn test_quantity_one_and_from_shares() {
        let one = Quantity::ONE;
        assert_eq!(one.to_f64(), 1.0);

        let hundred_shares = Quantity::from_shares(100);
        assert_eq!(hundred_shares.to_f64(), 100.0);
    }

    #[test]
    fn test_quantity_arithmetic() {
        let qty = Quantity::from_f64(10.0)?;
        let doubled = qty * 2.0;
        assert_eq!(doubled.to_f64(), 20.0);

        let halved = qty / 2.0;
        assert_eq!(halved.to_f64(), 5.0);
    }

    #[test]
    fn test_id_display() {
        let fill_id = FillId::new();
        assert!(fill_id.to_string().len() > 0);

        let trade_id = TradeId::new();
        assert!(trade_id.to_string().len() > 0);
    }
}
