示例#1
0
 public void GameBoardToStringSixBySix()
 {
     int gameBoardSize = 6;
     var target = new GameBoard(gameBoardSize);
     string expected = "  1 16 17 18 19 20\r\n 15  2 27 28 29 21\r\n 14 31  3 26 30 22\r\n 13 36 32  4 25 23\r\n 12 35 34 33  5 24\r\n 11 10  9  8  7  6\r\n";
     Engine engine = new Engine(gameBoardSize);
     var result = engine.Run();
     Assert.AreEqual(expected, result);
 }
示例#2
0
        public Form1()
        {
            InitializeComponent();

            gb = new GameBoard();
        }
示例#3
0
        public Form1()
        {
            InitializeComponent();

            gb = new GameBoard();
        }
示例#4
0
 public void GameBoardFindEmptyCellAllEmpty()
 {
     int gameBoardSize = 6;
     GameBoard target = new GameBoard(gameBoardSize);
     Tuple<int, int> expected = new Tuple<int, int>(0, 0);
     Tuple<int, int> actual = target.FindEmptyCell();
     Assert.AreEqual(expected, actual);
 }
示例#5
0
 public void GameBoardToStringTwoByTwo()
 {
     int gameBoardSize = 2;
     var target = new GameBoard(gameBoardSize);
     string expected = "  1  4\r\n  3  2\r\n";
     Engine engine = new Engine(gameBoardSize);
     var result = engine.Run();
     Assert.AreEqual(expected, result);
 }
示例#6
0
 public void GameBoardConstructorInvalidSizeOverOneHundred()
 {
     int gameBoardSize = 101;
     var target = new GameBoard(gameBoardSize);
 }
示例#7
0
 public void GameBoardConstructorInvalidSizeZero()
 {
     int gameBoardSize = 0;
     var target = new GameBoard(gameBoardSize);
 }
示例#8
0
 public void GameBoardConstructorInvalidSizeNegative()
 {
     var target = new GameBoard(-20);
 }
示例#9
0
 public void GameBoardConstructorTwentyByTwenty()
 {
     int gameBoardSize = 20;
     var target = new GameBoard(gameBoardSize);
     Assert.AreEqual(gameBoardSize, target.Board.GetLength(0));
 }
示例#10
0
 public void GameBoardConstructorSixBySix()
 {
     int gameBoardSize = 6;
     var target = new GameBoard(gameBoardSize);
     Assert.AreEqual(gameBoardSize, target.Board.GetLength(0));
 }
示例#11
0
 public void GameBoardChangeDirectionCurrentDownAndRight()
 {
     int gameBoardSize = 6;
     GameBoard target = new GameBoard(gameBoardSize);
     int currentDirectionX = 1;
     int currentDirectionY = 1;
     Tuple<int, int> expected = new Tuple<int, int>(1, 0);
     Tuple<int, int> actual = target.ChangeDirection(currentDirectionX, currentDirectionY);
     Assert.AreEqual(expected, actual);
 }
示例#12
0
 public void GameBoardCellContent()
 {
     int gameBoardSize = 6;
     GameBoard target = new GameBoard(gameBoardSize);
     int expected = 0;
     int actual = target.Board[0, 0];
     Assert.AreEqual(expected, actual);
 }