Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CyonAlexRDX committed Jan 16, 2024
1 parent 086ca16 commit c49428a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions profile/src/logic/profile_next_derivation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,24 @@ mod tests {
Err(CommonError::ProfileDoesNotContainFactorSourceWithID(lfs.factor_source_id()))
);
}

#[test]
fn device_factor_source_by_id_success_device() {
let profile = Profile::placeholder();
let dfs = DeviceFactorSource::placeholder_babylon();
assert_eq!(profile.device_factor_source_by_id(&dfs.id), Ok(dfs));
}

#[test]
fn device_factor_source_by_id_fail_unknown_id() {
let profile = Profile::placeholder();

let id =
FactorSourceIDFromHash::new_for_device(MnemonicWithPassphrase::placeholder_other());

assert_eq!(
profile.device_factor_source_by_id(&id),
Err(CommonError::ProfileDoesNotContainFactorSourceWithID(id.into()))
);
}
}

0 comments on commit c49428a

Please sign in to comment.