Ejemplo n.º 1
0
        public void savingTheBoard()
        {
            var gateway = Substitute.For <IDBgateway>();

            TicTacToeClass newgame = new TicTacToeClass(gateway);

            newgame.newGame();

            //newgame.nextMove('X', 0);

            newgame.SaveTheBoard();

            char[] expectedBoard = new char[9] {
                'E', 'E', 'E', 'E', 'E', 'E', 'E', 'E', 'E'
            };

            gateway.Received().save(expectedBoard);

            //Assert.AreEqual(expectedBoard, newgame.getTheBoard());
        }
Ejemplo n.º 2
0
        public void loadingTheBoard()
        {
            var gateway = Substitute.For <IDBgateway>();

            TicTacToeClass newgame = new TicTacToeClass(gateway);

            newgame.nextMove('X', 0);

            newgame.SaveTheBoard();

            newgame.nextMove('O', 1);

            char[] expectedBoard = new char[9] {
                'X', 'E', 'E', 'E', 'E', 'E', 'E', 'E', 'E'
            };

            gateway.load().Returns(expectedBoard);

            newgame.LoadTheBoard();

            Assert.AreEqual(expectedBoard, newgame.getTheBoard());
        }