You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.1 KiB
43 lines
1.1 KiB
package Game;
|
|
|
|
import org.junit.jupiter.api.AfterEach;
|
|
import org.junit.jupiter.api.BeforeEach;
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
|
|
|
class ChessTest {
|
|
|
|
Chess chess;
|
|
|
|
@BeforeEach
|
|
void setUp() {
|
|
chess = new Chess();
|
|
}
|
|
|
|
@AfterEach
|
|
void tearDown() {
|
|
}
|
|
|
|
@Test
|
|
void convertInput() {
|
|
int[] test1 = {0, 0};
|
|
int[] test2 = {7, 7};
|
|
int[] test3 = {6, 2};
|
|
|
|
assertNull(chess.convertInput("0g2"));
|
|
assertNull(chess.convertInput("25"));
|
|
assertNull(chess.convertInput("bg"));
|
|
assertNull(chess.convertInput("9b"));
|
|
assertNull(chess.convertInput("2i"));
|
|
|
|
assertArrayEquals(chess.convertInput("1a"), test1);
|
|
assertArrayEquals((chess.convertInput("a1")), test1);
|
|
assertArrayEquals((chess.convertInput("8h")), test2);
|
|
assertArrayEquals((chess.convertInput("h8")), test2);
|
|
|
|
assertArrayEquals((chess.convertInput("3G")), test3);
|
|
assertArrayEquals((chess.convertInput("G3")), test3);
|
|
}
|
|
}
|