public void PlaceTokenOnBoard_puts_token_in_correct_spot_on_board() { //Arrange var board = new StandardTestBoard(); int column = 1; int row = 1; var valueBeforePlacement = board.GetValueAtLocation(row, column); //Act board.PlaceTokenOnBoard(TickTackToeBoard.TickTackToeToken.O, row, column); var valueAfterPlacement = board.GetValueAtLocation(row, column); //Assert Assert.AreNotEqual(valueBeforePlacement, valueAfterPlacement); //TODO check to make sure no other elements in the array were changed (will need to use a fake/moq for this) }
public void PlaceTokenOnBoard_puts_token_in_available_spot_on_board() { //Arrange var board = new StandardTestBoard(); int column = 1; int row = 1; var valueBeforePlacement = board.GetValueAtLocation(row, column); //Act board.PlaceTokenOnBoard(TickTackToeBoard.TickTackToeToken.O, row, column); var valueAfterPlacement = board.GetValueAtLocation(row, column); //Assert Assert.AreEqual(TickTackToeBoard.TickTackToeToken.Available, valueBeforePlacement); Assert.AreNotEqual(valueBeforePlacement, valueAfterPlacement); }
public void GetValueAtLocation_throws_IndexOutOfRangeException_when_invalid_location_provided() { //Arrange var board = new StandardTestBoard(); //Act & Assert Assert.ThrowsException <IndexOutOfRangeException>(() => board.GetValueAtLocation(4, 4)); }
public void PlaceTokenOnBoard_puts_correct_token_in_spot_on_board() { //Arrange var board = new StandardTestBoard(); int column = 1; int row = 1; var token = TickTackToeBoard.TickTackToeToken.O; //Act board.PlaceTokenOnBoard(token, row, column); var valueAfterPlacement = board.GetValueAtLocation(row, column); //Assert Assert.AreEqual(token, valueAfterPlacement); }
public void GetValueAtLocation_returns_accurate_value() { //Arrange var board = new StandardTestBoard(); var token = TickTackToeBoard.TickTackToeToken.O; int expectedRow = 1; int expectedColumn = 2; board.PlaceTokenOnBoard(token, expectedRow, expectedColumn); //Act var value = board.GetValueAtLocation(expectedRow, expectedColumn); //Assert Assert.AreEqual(token, value); }