public void ShouldFinish() { RandomPlayer one = new RandomPlayer(); RandomPlayer two = new RandomPlayer(); GomokuEngine game = new GomokuEngine(one, two); // Random behavior can't really be tested. // "test" verifies that a game will eventually end with two RandomPlayers. while (!game.IsOver) { Result result; do { // Get the current (random) player and generate a random // stone from the existing game moves. Stone stone = game.Current.GenerateMove(game.Stones); result = game.Place(stone); Console.WriteLine(result); } while(!result.IsSuccess); } }
public void Setup() { // Create a new game before each test runs. game = new GomokuEngine(one, two); }
private void Form1_Load(object sender, EventArgs e) { GomokuObj = new GomokuEngine(); }