Skip to content

Commit 4f024b9

Browse files
committed
Update binary options tests
1 parent b069e03 commit 4f024b9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/options_pricing.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use approx::assert_abs_diff_eq;
22
use quantrs::options::{
3-
BinomialTreeModel, BlackScholesModel, EuropeanOption, Greeks, Instrument, MonteCarloModel,
4-
Option, OptionGreeks, OptionPricing, OptionType,
3+
AmericanOption, BinaryOption, BinomialTreeModel, BlackScholesModel, EuropeanOption, Greeks,
4+
Instrument, MonteCarloModel, Option, OptionGreeks, OptionPricing, OptionType,
55
};
66

77
// Function to assert that a type implements the Option trait
@@ -470,8 +470,6 @@ mod greeks_tests {
470470

471471
// Option Trait Tests
472472
mod option_trait_tests {
473-
use quantrs::options::AmericanOption;
474-
475473
use super::*;
476474

477475
#[test]
@@ -484,6 +482,10 @@ mod option_trait_tests {
484482
assert_implements_option_trait(&option);
485483
let option = AmericanOption::new(Instrument::new(100.0), 100.0, OptionType::Put);
486484
assert_implements_option_trait(&option);
485+
let option = BinaryOption::new(Instrument::new(100.0), 100.0, OptionType::Call);
486+
assert_implements_option_trait(&option);
487+
let option = BinaryOption::new(Instrument::new(100.0), 100.0, OptionType::Put);
488+
assert_implements_option_trait(&option);
487489

488490
let model = BlackScholesModel::new(1.0, 0.05, 0.2);
489491
assert_implements_model_trait(&model);

0 commit comments

Comments
 (0)