Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sajjon committed Nov 29, 2024
1 parent 307bcd8 commit cb0ecdc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"Appendable",
"Banksy",
"bdfs",
"fsid",
"Fulfillable",
"interactor",
"Interactors",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,36 @@ impl GeneralRoleWithHierarchicalDeterministicFactorInstances {
}
}

impl HasSampleValues for GeneralRoleWithHierarchicalDeterministicFactorInstances {
fn sample() -> Self {
Self::try_from((MatrixOfFactorInstances::sample(), RoleKind::Primary))
.expect("Sample should not fail")
}

fn sample_other() -> Self {
Self::try_from((MatrixOfFactorInstances::sample_other(), RoleKind::Recovery))
.expect("Sample should not fail")
}
}

#[cfg(test)]
mod test {
use super::*;

#[allow(clippy::upper_case_acronyms)]
type SUT = GeneralRoleWithHierarchicalDeterministicFactorInstances;

#[test]
fn equality() {
assert_eq!(SUT::sample(), SUT::sample());
assert_eq!(SUT::sample_other(), SUT::sample_other());
}

#[test]
fn inequality() {
assert_ne!(SUT::sample(), SUT::sample_other());
}

fn matrix() -> MatrixOfFactorInstances {
MatrixOfFactorInstances::sample()
}
Expand Down

0 comments on commit cb0ecdc

Please sign in to comment.