Question: How would i test this part of code in Junit5? please make some suggestions thanks package org.example.tictactoe. input; import public class InputParser { public cellSelection
package org.example.tictactoe. input; import public class InputParser { public cellSelection parseInput(String inputString, Tic Tac Toeboard board) throws Input MoveException { inputString = InputString.trim(); String[] parts = InputString.split( regexc","); try { if (parts.length !. 2) { throw new Input MoveException("Invalid number of coordinates"); } int row = Integer.parseInt(parts[0]); int col = Integer.parseInt(parts[1]); if (row 2 Il col > 2) { throw new Input MoveException("One of your selections was out of bounds); } 1 var selection = new CellSelection(row, col); if (!board. 1sLegalMove(selection)) throw new Input MoveException("That is not an allowed move"); 2 3 return selection; } catch (Number FormatException e) { throw new Input MoveException("Inputs must be numbers"); } e } 27 28 19 $0 31 blems Profiter Terminal Build Dependencies
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
