public void TestPlayerChange() { var playerQueue = new PlayerQueue(); var player = playerQueue.Current; //Has the player changed? playerQueue.ChangePlayer(); var newPlayer = playerQueue.Current; Assert.AreNotSame(newPlayer, player); //Are we back to the first player? playerQueue.ChangePlayer(); newPlayer = playerQueue.Current; Assert.AreSame(newPlayer, player); }
private void CreateGame() { Black = new Player(Token.Black); White = new Player(Token.White); var queue = new PlayerQueue(Black, White); Queue = queue; Game = new RevGame(Queue); SnapshotContainer = Game.SnapshotContainer; SnapshotContainer.SetInitialState(new OnePartTurn() { Board = Game.CloneBoard(), PlayerThatPlayed = White, PlayerToPlay = Black }); RaisePropertyChanged(() => Game); RaisePropertyChanged(() => SnapshotContainer); }