public void ShouldUseTheBoardToMakeAMove(BoardPosition position)
            {
                ITicTacToeGame subject = fixture.Create <TicTacToeGame>();

                subject.Move(position);

                mockBoard.Verify(x => x.Move(It.Is <BoardPosition>(pos => pos == position)), Times.Once);
            }
예제 #2
0
 private void Image_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     if (ticTacToeGame.IsGameOver)
     {
         return;
     }
     if (sender is Image image)
     {
         var currentTeamBitmap = currentTeam == Team.Zero ? bitmapImageTeamZero : bitmapImageTeamCross;
         if (Enum.TryParse(image.Uid, out BoardPosition position))
         {
             if (ticTacToeGame.Move(position))
             {
                 image.Source = currentTeamBitmap;
             }
         }
         else
         {
             throw new NotSupportedException(image.Uid);
         }
     }
 }