77 lines
2.5 KiB
Rust
77 lines
2.5 KiB
Rust
|
|
#[allow(unused)]
|
||
|
|
use pretty_assertions::{assert_eq, assert_ne, assert_str_eq};
|
||
|
|
|
||
|
|
use crate::{
|
||
|
|
diedto::DiedTo,
|
||
|
|
game::{Game, GameSettings, OrRandom, SetupRole},
|
||
|
|
game_test::{
|
||
|
|
ActionPromptTitleExt, ActionResultExt, AlignmentExt, GameExt, SettingsExt, gen_players,
|
||
|
|
},
|
||
|
|
message::night::{ActionPromptTitle, Visits},
|
||
|
|
role::{Role, RoleTitle},
|
||
|
|
};
|
||
|
|
|
||
|
|
#[test]
|
||
|
|
fn is_told_theyre_villager() {
|
||
|
|
assert_eq!(Role::Insomniac.initial_shown_role(), RoleTitle::Villager);
|
||
|
|
}
|
||
|
|
|
||
|
|
#[test]
|
||
|
|
fn sees_visits() {
|
||
|
|
let players = gen_players(1..21);
|
||
|
|
let insomniac_player_id = players[0].player_id;
|
||
|
|
let wolf_player_id = players[1].player_id;
|
||
|
|
let seer_player_id = players[2].player_id;
|
||
|
|
let arcanist_player_id = players[3].player_id;
|
||
|
|
let mut settings = GameSettings::empty();
|
||
|
|
settings.add_and_assign(SetupRole::Insomniac, insomniac_player_id);
|
||
|
|
settings.add_and_assign(SetupRole::Werewolf, wolf_player_id);
|
||
|
|
settings.add_and_assign(SetupRole::Seer, seer_player_id);
|
||
|
|
settings.add_and_assign(SetupRole::Arcanist, arcanist_player_id);
|
||
|
|
settings.fill_remaining_slots_with_villagers(20);
|
||
|
|
let mut game = Game::new(&players, settings).unwrap();
|
||
|
|
game.r#continue().r#continue();
|
||
|
|
assert_eq!(game.next().title(), ActionPromptTitle::WolvesIntro);
|
||
|
|
game.r#continue().sleep();
|
||
|
|
|
||
|
|
game.next().title().seer();
|
||
|
|
game.mark(game.living_villager().character_id());
|
||
|
|
game.r#continue().seer().village();
|
||
|
|
|
||
|
|
game.next().title().arcanist();
|
||
|
|
let mut villagers = game.villager_character_ids().into_iter();
|
||
|
|
game.mark(villagers.next().unwrap());
|
||
|
|
game.mark(villagers.next().unwrap());
|
||
|
|
assert_eq!(game.r#continue().arcanist(), true);
|
||
|
|
|
||
|
|
game.next_expect_day();
|
||
|
|
|
||
|
|
game.execute().title().wolf_pack_kill();
|
||
|
|
game.mark(game.living_villager().character_id());
|
||
|
|
game.r#continue().sleep();
|
||
|
|
|
||
|
|
game.next().title().seer();
|
||
|
|
game.mark(
|
||
|
|
game.character_by_player_id(insomniac_player_id)
|
||
|
|
.character_id(),
|
||
|
|
);
|
||
|
|
game.r#continue().seer().village();
|
||
|
|
|
||
|
|
game.next().title().arcanist();
|
||
|
|
game.mark(game.character_by_player_id(seer_player_id).character_id());
|
||
|
|
game.mark(
|
||
|
|
game.character_by_player_id(insomniac_player_id)
|
||
|
|
.character_id(),
|
||
|
|
);
|
||
|
|
assert_eq!(game.r#continue().arcanist(), true);
|
||
|
|
|
||
|
|
game.next().title().insomniac();
|
||
|
|
assert_eq!(
|
||
|
|
game.r#continue().insomniac(),
|
||
|
|
Visits::new(Box::new([
|
||
|
|
game.character_by_player_id(seer_player_id).identity(),
|
||
|
|
game.character_by_player_id(arcanist_player_id).identity()
|
||
|
|
]))
|
||
|
|
);
|
||
|
|
}
|