use crate::{Act, Workflow};
#[test]
fn model_valid_step_id() {
let m = Workflow::new()
.with_step(|step| step.with_id("step1"))
.with_step(|step| step.with_id("step1"));
assert!(m.valid().is_err());
}
#[test]
fn model_valid_act_id() {
let m = Workflow::new().with_step(|step| {
step.with_id("step1")
.with_act(Act::irq(|act| act.with_key("key1")).with_id("act1"))
.with_act(Act::irq(|act| act.with_key("key1")).with_id("act1"))
});
assert!(m.valid().is_err());
}
#[test]
fn model_valid_same_tag() {
let m = Workflow::new().with_step(|step| {
step.with_id("step1")
.with_tag("tag1")
.with_act(Act::irq(|act| act.with_tag("tag1")))
.with_act(Act::irq(|act| act.with_tag("tag1")))
});
assert!(m.valid().is_ok());
}