public void EndingANotStartedFight_ThrowsInvalidActionException_Test() { // Arrange var quest = QuestFactory.CreateStartedWithMaleHero(out var gameStore, out var gameId, out var playerId, out var sequence); var hero = new Hero(PlayerFactory.CreateMale("GI Joe")); var endFight = FightEndMessage.Create(sequence.Next, badThings); // Act & Assert Assert.Throws <InvalidActionException>(() => quest.AddMessage(gameId, endFight)); }
public void StartAndEndAFight_ResultingInAnEmptyFightState_Test() { var quest = QuestFactory.CreateStartedWithMaleHero( out var gameStore, out var gameId, out var playerId, out var sequence); var game = quest.GetState(gameId); var hero = game.GetHero(playerId); var startFight = FightStartMessage.Create(sequence.Next, hero.Player.Id, zerschmetterling); var endFight = FightEndMessage.Create(sequence.Next, badThings); quest.AddMessage(gameId, startFight); game = quest.AddMessage(gameId, endFight); Assert.Null(game.Score.Fight); }