Skip to content

Commit

Permalink
✅ Add tests on high level API
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurlm committed Nov 13, 2023
1 parent a13946a commit 050942c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion quickfix/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::ffi::NulError;

use thiserror::Error;

#[derive(Debug, Error)]
#[derive(Debug, Error, PartialEq, Eq, Clone)]
pub enum QuickFixError {
#[error("invalid function return")]
InvalidFunctionReturn,
Expand Down
22 changes: 22 additions & 0 deletions quickfix/tests/test_lifecycle.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
use quickfix::{FileLogFactory, FileStoreFactory, QuickFixError, SessionSettings};

#[test]
fn test_session_settings() {
assert_eq!(
SessionSettings::try_new("invalid_file.ini").unwrap_err(),
QuickFixError::InvalidFunctionReturn
);
let _settings = SessionSettings::try_new("../example/settings.ini").unwrap();
}

#[test]
fn test_file_log_factory() {
let settings = SessionSettings::try_new("../example/settings.ini").unwrap();
let _file_log_factory = FileLogFactory::try_new(&settings).unwrap();
}

#[test]
fn test_file_store_factory() {
let settings = SessionSettings::try_new("../example/settings.ini").unwrap();
let _file_store_factory = FileStoreFactory::try_new(&settings).unwrap();
}

0 comments on commit 050942c

Please sign in to comment.