nautilus_model/types/
stubs.rs

1//  Copyright (C) 2015-2026 Nautech Systems Pty Ltd. All rights reserved.
2//  https://nautechsystems.io
3//
4//  Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
5//  You may not use this file except in compliance with the License.
6//  You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html
7//
8//  Unless required by applicable law or agreed to in writing, software
9//  distributed under the License is distributed on an "AS IS" BASIS,
10//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11//  See the License for the specific language governing permissions and
12//  limitations under the License.
13// -------------------------------------------------------------------------------------------------
14
15use rstest::fixture;
16
17use crate::{
18    identifiers::stubs::instrument_id_btc_usdt,
19    types::{AccountBalance, MarginBalance, Money},
20};
21
22#[fixture]
23pub fn stub_account_balance() -> AccountBalance {
24    let total = Money::from("1525000 USD");
25    let locked = Money::from("25000 USD");
26    let free = Money::from("1500000 USD");
27    AccountBalance::new(total, locked, free)
28}
29
30#[fixture]
31pub fn stub_margin_balance() -> MarginBalance {
32    let initial = Money::from("5000 USD");
33    let maintenance = Money::from("20000 USD");
34    let instrument = instrument_id_btc_usdt();
35    MarginBalance::new(initial, maintenance, instrument)
36}