예제 #1
0
 public void Initialized_Chess_Has_Linked_Pieces_To_Each_Player()
 {
     Mock<IPlayer> whitePlayerMock = new Mock<IPlayer>();
     Mock<IPlayer> blackPlayerMock = new Mock<IPlayer>();
     chess = new ChessEngine( new Board(), whitePlayerMock.Object, blackPlayerMock.Object, new ConfigChess() );
     chess.Initialize();
     whitePlayerMock.VerifySet( x => x.Pieces = It.IsAny<Dictionary<Piece, string>>() );
     blackPlayerMock.VerifySet( x => x.Pieces = It.IsAny<Dictionary<Piece, string>>() );
 }
예제 #2
0
        public void Initialized_Chess_Has_A_Board_Initialized()
        {
            ConfigChess config = new ConfigChess();
            var boardMock = new Mock<IBoard>();
            boardMock.Setup( x => x.Initialize( config.ListHorizontalBoardCoordinates(), config.ListVerticalBoardCoordinates() ) );

            chess = new ChessEngine( boardMock.Object, new Player( Player.PlayerColor.White ), new Player( Player.PlayerColor.Black ), new ConfigChess() );
            chess.Initialize();

            boardMock.Verify();
        }
예제 #3
0
 public void Initialized_Chess_Has_Placed_Pieces_On_The_Board_For_2_Players()
 {
     Mock<IBoard> boardMock = new Mock<IBoard>();
     chess = new ChessEngine( boardMock.Object, new Player( Player.PlayerColor.White ), new Player( Player.PlayerColor.Black ), new ConfigChess() );
     chess.Initialize();
     boardMock.Verify( x => x.PlaceCollectionOfPieces( It.IsAny<Dictionary<Piece, string>>() ), Times.Exactly( 2 ) );
 }