-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a575750
commit 1bb0eb5
Showing
1 changed file
with
51 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,74 @@ | ||
#[cfg(test)] | ||
|
||
mod tests { | ||
|
||
use atelier::data::market::Orderbook; | ||
//use atelier::data::market::Orderbook; | ||
|
||
const BID_PRICE: f64 = 50_000.00; | ||
const ASK_PRICE: f64 = 50_100.00; | ||
const TICK_SIZE: f64 = 100.0; | ||
const N_LEVELS: u32 = 10; | ||
const N_ORDERS: u32 = 5; | ||
//const BID_PRICE: f64 = 50_000.00; | ||
//const ASK_PRICE: f64 = 50_100.00; | ||
//const TICK_SIZE: f64 = 100.0; | ||
//const N_LEVELS: u32 = 10; | ||
//const N_ORDERS: u32 = 5; | ||
|
||
// ------------------------------------------------------------------ FIND_LEVEL -- / | ||
// ------------------------------------------------------------------ ---------- -- / | ||
|
||
#[test] | ||
fn find_level() { | ||
let test_ob = Orderbook::synthetize(BID_PRICE, ASK_PRICE, TICK_SIZE, N_LEVELS, N_ORDERS); | ||
|
||
// the price of the level to be searched. | ||
let t_level_price = 50_300.00; | ||
let level_found = test_ob.find_level(&t_level_price).unwrap(); | ||
|
||
// println!("level_found content: {:?}", level_found); | ||
assert_eq!(level_found, 1); | ||
} | ||
} | ||
// -------------------------------------------------------------- RETRIEVE_LEVEL -- / | ||
// -------------------------------------------------------------- -------------- -- / | ||
// #[test] | ||
// fn find_level() { | ||
// } | ||
// -------------------------------------------------------------- RETRIEVE_LEVEL -- / | ||
// -------------------------------------------------------------- -------------- -- / | ||
|
||
// #[test] | ||
// fn retrieve_level() { | ||
// } | ||
// #[test] | ||
// fn retrieve_level() { | ||
// } | ||
|
||
// ---------------------------------------------------------------- DELETE_LEVEL -- / | ||
// ---------------------------------------------------------------- ------------ -- / | ||
// ---------------------------------------------------------------- DELETE_LEVEL -- / | ||
// ---------------------------------------------------------------- ------------ -- / | ||
|
||
// #[test] | ||
// fn delete_level() { | ||
// } | ||
// #[test] | ||
// fn delete_level() { | ||
// } | ||
|
||
// ---------------------------------------------------------------- INSERT_LEVEL -- / | ||
// ---------------------------------------------------------------- ------------ -- / | ||
// ---------------------------------------------------------------- INSERT_LEVEL -- / | ||
// ---------------------------------------------------------------- ------------ -- / | ||
|
||
// #[test] | ||
// fn insert_level() { | ||
// } | ||
// #[test] | ||
// fn insert_level() { | ||
// } | ||
|
||
// ------------------------------------------------------------------ FIND_ORDER -- / | ||
// ------------------------------------------------------------------ ---------- -- / | ||
|
||
// #[test] | ||
// fn find_order() { | ||
// } | ||
// ------------------------------------------------------------------ FIND_ORDER -- / | ||
// ------------------------------------------------------------------ ---------- -- / | ||
|
||
// -------------------------------------------------------------- RETRIEVE_ORDER -- / | ||
// -------------------------------------------------------------- -------------- -- / | ||
// #[test] | ||
// fn find_order() { | ||
// } | ||
|
||
// #[test] | ||
// fn retrieve_order() { | ||
// } | ||
// -------------------------------------------------------------- RETRIEVE_ORDER -- / | ||
// -------------------------------------------------------------- -------------- -- / | ||
|
||
// ---------------------------------------------------------------- DELETE_ORDER -- / | ||
// ---------------------------------------------------------------- ------------ -- / | ||
// #[test] | ||
// fn retrieve_order() { | ||
// } | ||
|
||
// #[test] | ||
// fn delete_order() { | ||
// } | ||
// ---------------------------------------------------------------- DELETE_ORDER -- / | ||
// ---------------------------------------------------------------- ------------ -- / | ||
|
||
// ---------------------------------------------------------------- INSERT_ORDER -- / | ||
// ---------------------------------------------------------------- ------------ -- / | ||
// #[test] | ||
// fn delete_order() { | ||
// } | ||
|
||
// #[test] | ||
// fn insert_order() { | ||
// } | ||
// ---------------------------------------------------------------- INSERT_ORDER -- / | ||
// ---------------------------------------------------------------- ------------ -- / | ||
|
||
// ---------------------------------------------------------------- MODIFY_ORDER -- / | ||
// ---------------------------------------------------------------- ------------ -- / | ||
// #[test] | ||
// fn insert_order() { | ||
// } | ||
|
||
// #[test] | ||
// fn modify_order() { | ||
// } | ||
// ---------------------------------------------------------------- MODIFY_ORDER -- / | ||
// ---------------------------------------------------------------- ------------ -- / | ||
|
||
//} | ||
// #[test] | ||
// fn modify_order() { | ||
// } | ||
} |