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()); }
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()); }