Adds another test for after you
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
ebc1565429
commit
b9351d057e
|
@ -44,7 +44,7 @@ mod tests {
|
|||
use super::*;
|
||||
use alloc::rc::Rc;
|
||||
use pkmn_lib_interface::app_interface::{
|
||||
MockBattle, MockChoiceQueue, MockExecutingMove, MockPokemon,
|
||||
MockBattle, MockChoiceQueue, MockExecutingMove, MockHitData, MockPokemon,
|
||||
};
|
||||
|
||||
#[test]
|
||||
|
@ -70,4 +70,36 @@ mod tests {
|
|||
let script = AfterYou::new();
|
||||
script.on_secondary_effect(Rc::new(MockExecutingMove::new()), target, 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fails_when_move_pokemon_choice_next_can_not_move() {
|
||||
let mut battle = MockBattle::new();
|
||||
battle.expect_choice_queue().once().return_once_st(move || {
|
||||
let mut choice_queue = MockChoiceQueue::new();
|
||||
choice_queue
|
||||
.expect_move_pokemon_choice_next()
|
||||
.once()
|
||||
.return_const(false);
|
||||
Rc::new(choice_queue)
|
||||
});
|
||||
|
||||
let battle = Rc::new(battle);
|
||||
let mut target = MockPokemon::new();
|
||||
target
|
||||
.expect_battle()
|
||||
.once()
|
||||
.return_once_st(move || Some(battle));
|
||||
let target = Rc::new(target);
|
||||
|
||||
let mut mv = MockExecutingMove::new();
|
||||
mv.expect_get_hit_data().once().returning_st(move |_, _| {
|
||||
let mut hit = MockHitData::new();
|
||||
hit.expect_fail().once();
|
||||
Rc::new(hit)
|
||||
});
|
||||
let mv = Rc::new(mv);
|
||||
|
||||
let script = AfterYou::new();
|
||||
script.on_secondary_effect(mv, target, 0);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue