use pipecircuit::StateMachine;
use super::{Activate, Latch};
use crate::domain_primitives::Activation;
#[test]
fn a_new_latch_activates() {
assert_eq!(Latch::default().step(Activate), Activation::Activated);
}
#[test]
fn repeated_activation_preserves_the_active_state() {
let mut latch = Latch::default();
assert_eq!(latch.step(Activate), Activation::Activated);
for _ in 0..3 {
assert_eq!(latch.step(Activate), Activation::AlreadyActive);
}
}