package tictactoe.game.player;

import org.junit.Assert;
import org.junit.Test;
import tictactoe.game.engine.TicTacToeMove;

import java.util.ArrayList;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class TicTacToePlayerStrategyTest {

    TicTacToePlayerStrategy strategy = mock(TicTacToePlayerStrategy.class);

    @Test
    public void testGenerateMove() {
        // define playerMove return
        when(strategy.generateMove(new ArrayList<>()))
                .thenReturn(new TicTacToeMove(3,3));

        Assert.assertEquals("Player strategy generate move",
                strategy.generateMove(new ArrayList<>()),
                new TicTacToeMove(3,3));
    }

}

@@ -308,16 +308,20 @@
 strategy
+Mock
  = mock(
@@ -352,16 +352,16 @@
 class);%0A
-
 %0A    @Te
@@ -449,32 +449,36 @@
    when(strategy
+Mock
 .generateMove(ne
@@ -634,16 +634,20 @@
 strategy
+Mock
 .generat
@@ -720,10 +720,897 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void testParseMove() %7B%0A        TicTacToePlayerStrategy strategy = new TicTacToePlayerStrategy();%0A%0A        String badMove1 = %223.3%22;%0A        String badMove2 = %2233%22;%0A        String badMove3 = %22asdf%22;%0A        String correctMove = %223,3%22;%0A%0A        Assert.assertEquals(%22badMove1 should return invalid move%22,%0A                new TicTacToeMove(0,0),%0A                strategy.parseMove(badMove1));%0A%0A        Assert.assertEquals(%22badMove2 should return invalid move%22,%0A                new TicTacToeMove(0,0),%0A                strategy.parseMove(badMove2));%0A%0A        Assert.assertEquals(%22badMove3 should return invalid move%22,%0A                new TicTacToeMove(0,0),%0A                strategy.parseMove(badMove3));%0A%0A        Assert.assertEquals(%22correctMove should return a valid move%22,%0A                new TicTacToeMove(3,3),%0A                strategy.parseMove(correctMove));%0A    %7D%0A%0A
 %7D%0A

test parse move