use eventcore::{Command, CommandStreams, StreamId};
#[derive(Command)]
struct TransferFundsCommand {
#[stream]
from: StreamId,
#[stream]
to: StreamId,
}
#[test]
fn command_macro_multi_stream_declares_both_streams() {
let command = TransferFundsCommand {
from: StreamId::try_new("from".to_owned()).expect("valid stream id"),
to: StreamId::try_new("to".to_owned()).expect("valid stream id"),
};
let declared: Vec<_> = command.stream_declarations().iter().cloned().collect();
assert_eq!(declared, vec![command.from, command.to]);
}