public void AdvanceMovesFirstPlayerToLastPosition() { PlayerDeque deque = new PlayerDeque(generator, playerFactory); var first = deque[0]; deque.AdvanceDeque(); Assert.AreEqual(first, deque[deque.Count - 1]); }
public void TakeTurnAdvancesPlayerAndPushesHimToBackOfDeque() { PlayerDeque deque = new PlayerDeque(generator, playerFactory); var first = deque[0]; var position = first.Position; deque.TakeTurn(); Assert.AreNotEqual(position, first.Position); Assert.AreEqual(first, deque[deque.Count - 1]); }
public void ShuffleReordersPlayers() { // Unfortunately the shuffled version with this generator is the same :( string[] shuffledPlayers = new string[] { players[0], players[1], players[2], players[3], }; PlayerDeque deque = new PlayerDeque(generator, playerFactory); Assert.IsTrue(shuffledPlayers.SequenceEqual(deque.Select(x => x.Name).ToArray())); }
public void Setup() { generator = new RandomGeneratorMoc(); string[] properties = { "a", "b", "c" }; gameBoard = new Board(new PropertyFactory(properties)); string[] players = { "a", "b", "c", "d", "e" }; playerDeque = new PlayerDeque(generator, new PlayerFactory(players, generator, gameBoard)); game = new Game(gameBoard); game.Players = playerDeque; }