public void to_country_owned_by_player() { var command = new Commands.Deploy( Belgium, Player.P1.Army(3), GameId, ExpectedVersion: 4); Handle(command, Benelux()).Should().BeInvalid() .WithMessage(ValidationMessage.Error("Country Belgium must be owned by P1.")); }
public void with_army_that_not_exceeds_available() { var command = new Commands.Deploy( Netherlands, Player.P1.Army(4), GameId, ExpectedVersion: 4); Handle(command, Benelux()).Should().BeInvalid() .WithMessage(ValidationMessage.Error("Action not be executed as it requires more armies (P1.Army(4)) then available (P1.Army(3)).")); }
public void to_existing_country() { var command = new Commands.Deploy( Unknown, Player.P1.Army(3), GameId, ExpectedVersion: 4); Handle(command, Benelux()).Should().BeInvalid() .WithMessage(ValidationMessage.Error("Country with id 666 does not exist.")); }
public void by_active_player() { var command = new Commands.Deploy( Netherlands, Player.P2.Army(3), GameId, ExpectedVersion: 4); Handle(command, Benelux()).Should().BeInvalid() .WithMessage(ValidationMessage.Error("Action can only be applied by the active P1, not by P2.")); }
public void in_deploy_phase() { var command = new Commands.Deploy( Netherlands, Player.P1.Army(3), GameId, ExpectedVersion: 5); Handle(command, Benelux().Deploy()).Should().BeInvalid() .WithMessage(ValidationMessage.Error("Action must be in the Deploy phase to be executed, not in the Attack phase.")); }
public void Can_only_be_applied_on_own_country() { var command = new Commands.Deploy( Luxembourg, Player.P1.Army(3), GameId, ExpectedVersion: 4); Handle(command, Benelux()).Should().BeInvalid() .WithMessage(ValidationMessage.Error("Country Luxembourg must be owned by P1.")); }
public void Can_be_applied_by_active_player() { var command = new Commands.Deploy( Netherlands, Player.P1.Army(3), GameId, ExpectedVersion: 4); Handle(command, Benelux()).Should().BeValid() .Value.Countries.ById(Netherlands).Army.Should().Be(Player.P1.Army(6)); }
public void and_moves_to_attack_phase_when_out_deployments() { var command = new Commands.Deploy( Netherlands, Player.P1.Army(3), GameId, ExpectedVersion: 4); var game = Handle(command, Benelux()).Should().BeValid().Value; game.Countries.ById(Netherlands).Army.Should().Be(Player.P1.Army(6)); game.ArmyBuffer.Should().Be(Army.None); game.Phase.Should().Be(GamePhase.Attack); }
public void and_stays_in_deploy_phase_when_deployment_left() { var command = new Commands.Deploy( Netherlands, Player.P1.Army(2), GameId, ExpectedVersion: 4); var game = Handle(command, Benelux()).Should().BeValid().Value; game.Countries.ById(Netherlands).Army.Should().Be(Player.P1.Army(5)); game.ArmyBuffer.Should().Be(Player.P1.Army(1)); game.Phase.Should().Be(GamePhase.Deploy); }