use super::TransferReason;
#[test]
fn all_lists_every_variant() {
for reason in TransferReason::ALL {
match reason {
TransferReason::Sale
| TransferReason::Return
| TransferReason::Remanufacturing
| TransferReason::Repurposing
| TransferReason::PreparationForReuse
| TransferReason::PreparationForRepurposing
| TransferReason::WasteHandover
| TransferReason::Import
| TransferReason::InsolvencySuccession => {}
}
}
assert_eq!(
TransferReason::ALL.len(),
9,
"a variant was added to the match above but not to ALL"
);
}
#[test]
fn every_art_77_7_operation_is_expressible() {
let operations = [
TransferReason::PreparationForReuse,
TransferReason::PreparationForRepurposing,
TransferReason::Repurposing,
TransferReason::Remanufacturing,
];
for operation in &operations {
assert!(
TransferReason::ALL.contains(operation),
"{operation:?} is an Art. 77(7) operation and must be in ALL"
);
}
let wire: Vec<&str> = operations.iter().map(TransferReason::wire_str).collect();
assert_eq!(
wire,
[
"preparationForReuse",
"preparationForRepurposing",
"repurposing",
"remanufacturing",
],
"the wire vocabulary a registry receives must name each operation distinctly"
);
}