Skip to content
Snippets Groups Projects
Commit ebd0687b authored by dsjohns2's avatar dsjohns2
Browse files

week1 submission

parent 35f14239
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,9 @@ import java.util.concurrent.TimeUnit;
*/
public class Main {
public static void main(String[] args) throws InterruptedException {
Test test = new Test();
test.run_tests();
Game my_game = new Game();
my_game.initialize_board();
my_game.print_board(my_game.board);
......
package com.company;
import java.util.List;
import java.util.Vector;
/**
* This is the testing class
*/
public class Test {
/**
* A method to run all my tests
*/
public void run_tests(){
get_piece_name_test();
}
/**
* A method to test the get_piece_name method
*/
public void get_piece_name_test(){
Game test_game = new Game();
assert (test_game.get_piece_name(1, 6) == "P");
assert (test_game.get_piece_name(0, 4) == "K");
assert (test_game.get_piece_name(7, 6) == "R");
}
/**
* A method to test the make_move method
*/
public void make_move_test() throws InterruptedException {
Game test_game = new Game();
test_game.initialize_board();
assert (test_game.make_move() == -1);
}
/**
* A method to test the pick_move method
*/
public void pick_move_test() throws InterruptedException {
Game test_game = new Game();
test_game.initialize_board();
assert (test_game.make_move() == -1);
}
/**
* A method to test the legal_square_addition method
*/
public void legal_square_addition_test() throws InterruptedException {
Piece test_piece = new Piece();
List<int[]> squares = new Vector<int[]>();
int[] square = new int[2];
square[0] = 2;
square[1] = 3;
squares.add(square);
assert(test_piece.legal_square_addition(2, 3) == squares);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment