/// <summary> /// Default Constructor for GameManager Class /// </summary> public GameManager() { InitializeComponent(); GmBoard = Board.createInstance(BoardSize); Logic = new ComputerMoveHandler(GmBoard, CoinCount); GView = new GameView(); }
public void CalculateStepThreeTest() { Board board = Board.createInstance(25); // TODO: Initialize to an appropriate value int gameSize = 5; // TODO: Initialize to an appropriate value ComputerMoveHandler target = new ComputerMoveHandler(board, gameSize); // TODO: Initialize to an appropriate value target.MakeMove(new Point(1, 1), Symbol.Cross); IComparable actual; actual = target.CalculateStepThree(new Point(1,1), Symbol.Cross); target = null; board = null; Assert.Inconclusive("Value returned based on the formula"); }
public void CalculateStepOneTest() { Board board = Board.createInstance(25); // TODO: Initialize to an appropriate value int gameSize = 5; // TODO: Initialize to an appropriate value ComputerMoveHandler target = new ComputerMoveHandler(board, gameSize); // TODO: Initialize to an appropriate value target.MakeMove(new Point(15, 15), Symbol.Oval); Point position = new Point(15,16); // TODO: Initialize to an appropriate value Symbol coin = Symbol.Oval; // TODO: Initialize to an appropriate value int expected = 2; // TODO: Initialize to an appropriate value int actual; actual = target.CalculateStepOne(position, coin); Assert.AreEqual(expected, actual); target = null; board = null; }
public void CountCoinTest() { Board board = Board.createInstance(25); // TODO: Initialize to an appropriate value int gameSize = 5; // TODO: Initialize to an appropriate value ComputerMoveHandler target = new ComputerMoveHandler(board, gameSize); // TODO: Initialize to an appropriate value target.MakeMove(new Point(5, 5), Symbol.Cross); target.MakeMove(new Point(5, 6), Symbol.Cross); target.MakeMove(new Point(5, 7), Symbol.Cross); target.MakeMove(new Point(5, 8), Symbol.Cross); Point position = new Point(5,9); // TODO: Initialize to an appropriate value Symbol coin = Symbol.Cross; // TODO: Initialize to an appropriate value int expected = 4; // TODO: Initialize to an appropriate value int actual; actual = target.CountCoin(position, coin); Assert.AreEqual(expected, actual); target = null; board = null; }
public void CheckResultTest1() { Board board = Board.createInstance(25); // TODO: Initialize to an appropriate value int gameSize = 5; // TODO: Initialize to an appropriate value ComputerMoveHandler TargetTest = new ComputerMoveHandler(board, gameSize); // TODO: Initialize to an appropriate value TargetTest.MakeMove(new Point(5, 5), Symbol.Cross); TargetTest.MakeMove(new Point(5, 6), Symbol.Cross); TargetTest.MakeMove(new Point(5, 7), Symbol.Cross); TargetTest.MakeMove(new Point(5, 8), Symbol.Cross); Point position = new Point(5, 8); // TODO: Initialize to an appropriate value Symbol coin = Symbol.Cross; // TODO: Initialize to an appropriate value bool expected = false; // TODO: Initialize to an appropriate value bool actual; actual = TargetTest.CheckResult(position, coin); Assert.AreEqual(expected, actual); TargetTest = null; board = null; // Assert.Inconclusive("Verify the correctness of this test method."); }
public void StepTwoTest() { Board board = Board.createInstance(25); // TODO: Initialize to an appropriate value int gameSize = 5; // TODO: Initialize to an appropriate value ComputerMoveHandler Step2Target = new ComputerMoveHandler(board, gameSize); // TODO: Initialize to an appropriate value Step2Target.MakeMove(new Point(5, 5), Symbol.Cross); Step2Target.MakeMove(new Point(5, 6), Symbol.Cross); Step2Target.MakeMove(new Point(5, 7), Symbol.Cross); Step2Target.MakeMove(new Point(6, 7), Symbol.Oval); List<Point> pos = new List<Point>() {new Point(5,8),new Point(5,4)}; // TODO: Initialize to an appropriate value Symbol coin = Symbol.Cross; // TODO: Initialize to an appropriate value List<Point> expected = new List<Point>(){new Point(5,8)}; // TODO: Initialize to an appropriate value List<Point> actual; actual = Step2Target.StepTwo(pos, coin); Assert.AreEqual(expected.ToString(), actual.ToString()); Step2Target = null; board = null; }
public void StepThreeTest() { Board board = Board.createInstance(25); // TODO: Initialize to an appropriate value int gameSize = 5; // TODO: Initialize to an appropriate value ComputerMoveHandler Step3Target = new ComputerMoveHandler(board, gameSize); // TODO: Initialize to an appropriate value List<Point> pos = new List<Point>(){new Point(0,0),new Point(0,1)}; // TODO: Initialize to an appropriate value Symbol coin = Symbol.Cross; // TODO: Initialize to an appropriate value List<Point> expected = new List<Point>(){new Point(0,1)} ; // TODO: Initialize to an appropriate value List<Point> actual; actual = Step3Target.StepThree(pos, coin); Assert.AreEqual(expected.ToString(), actual.ToString()); Step3Target = null; board = null; }
public void StepOneTest() { Board board = Board.createInstance(25); // TODO: Initialize to an appropriate value int gameSize = 5; // TODO: Initialize to an appropriate value ComputerMoveHandler target = new ComputerMoveHandler(board, gameSize); // TODO: Initialize to an appropriate value target.MakeMove(new Point(5, 5), Symbol.Cross); target.MakeMove(new Point(5, 6), Symbol.Cross); target.MakeMove(new Point(5, 7), Symbol.Cross); Symbol coin = Symbol.Cross; // TODO: Initialize to an appropriate value List<Point> expected = new List<Point>(); // TODO: Initialize to an appropriate value expected.Add(new Point(5, 4)); expected.Add(new Point(5, 8)); List<Point> actual1; actual1 = target.StepOne(coin); List<Point> Actual = new List<Point>(); foreach (Point ptr in actual1) { Actual.Add(ptr); } Assert.AreEqual(expected.ToString(), Actual.ToString()); target = null; board = null; }
public void SelectBestMoveTest() { Board board = Board.createInstance(25); // TODO: Initialize to an appropriate value int gameSize = 5; // TODO: Initialize to an appropriate value ComputerMoveHandler targetnew = new ComputerMoveHandler(board, gameSize); // TODO: Initialize to an appropriate value targetnew.MakeMove(new Point(5, 5), Symbol.Oval); targetnew.MakeMove(new Point(5, 6), Symbol.Cross); targetnew.MakeMove(new Point(5, 7), Symbol.Cross); targetnew.MakeMove(new Point(5, 8), Symbol.Cross); Symbol coin = Symbol.Cross; // TODO: Initialize to an appropriate value Point expected = new Point(5,9); // TODO: Initialize to an appropriate value Point actual; actual = targetnew.SelectBestMove(coin); Assert.AreEqual(expected, actual); }
public void MakeMoveTest() { Board board = Board.createInstance(25); // TODO: Initialize to an appropriate value int gameSize = 5; // TODO: Initialize to an appropriate value ComputerMoveHandler target = new ComputerMoveHandler(board, gameSize); // TODO: Initialize to an appropriate value Point position = new Point(); // TODO: Initialize to an appropriate value Symbol coin = new Symbol(); // TODO: Initialize to an appropriate value target.MakeMove(position, coin); target = null; board = null; }
public void GetUserSymbolTest() { Board board = Board.createInstance(25); // TODO: Initialize to an appropriate value int gameSize = 5; // TODO: Initialize to an appropriate value ComputerMoveHandler target = new ComputerMoveHandler(board, gameSize); // TODO: Initialize to an appropriate value Symbol coin = Symbol.Cross; // TODO: Initialize to an appropriate value Symbol expected = Symbol.Oval; // TODO: Initialize to an appropriate value Symbol actual; actual = target.GetUserSymbol(coin); Assert.AreEqual(expected, actual); board = null; target = null; }