|
|
@ -1,7 +1,5 @@ |
|
|
|
package Game; |
|
|
|
|
|
|
|
import org.junit.Rule; |
|
|
|
import org.junit.contrib.java.lang.system.SystemOutRule; |
|
|
|
import org.junit.jupiter.api.AfterEach; |
|
|
|
import org.junit.jupiter.api.BeforeEach; |
|
|
|
import org.junit.jupiter.api.Test; |
|
|
@ -41,4 +39,12 @@ class TictactoeTest { |
|
|
|
ttt.print(); |
|
|
|
assertEquals("Hello\nWorld\n!!!\n", outContent.toString().replaceAll("\r", "")); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
void getStatedChar() { |
|
|
|
assertEquals(ttt.getStatedChar(Tictactoe.State.CIRCLE), 'O'); |
|
|
|
assertEquals(ttt.getStatedChar(Tictactoe.State.CROSS), 'X'); |
|
|
|
assertEquals(ttt.getStatedChar(Tictactoe.State.EMPTY), ' '); |
|
|
|
} |
|
|
|
} |