siphon test

This commit is contained in:
ntr 2019-12-10 17:00:04 +10:00
parent 47b92a5b80
commit 157bca6658

View File

@ -1703,4 +1703,29 @@ mod tests {
_ => false,
}));
}
#[test]
fn siphon_test() {
let mut game = create_2v2_test_game();
let player_id = game.players[0].id;
let source = game.players[0].constructs[0].id;
let target = game.players[1].constructs[0].id;
game.resolve(Cast::new(source, player_id, target, Skill::Siphon));
let last = game.resolutions.len() - 1;
let resolutions = &game.resolutions[last];
assert!(resolutions.iter().any(|r| match r.event {
Event::Damage { construct, colour, amount, mitigation: _, display: _ } =>
construct == target && amount > 0 && colour == Colour::Blue,
_ => false,
}));
assert!(resolutions.iter().any(|r| match r.event {
Event::Healing { construct, colour, amount, overhealing: _ } =>
construct == source && amount > 0 && colour == Colour::Green,
_ => false,
}));
}
}