I have an assingment that require me to test if a matrix meets a certain requirement, which I have completed, and then test it in a JUnit test, which I don't know how. I have created the folder for the JUnit test but I don't know how to write the test. So far I did the test in the main class.
public static void main(String[] args) {
int matrix[][] = {{2,7,6},{9,5,1},{4,3,8}};
System.out.println(isMagicSquare(matrix));
// changing one element
matrix[0][2] = 5;
System.out.println(isMagicSquare(matrix));
}
public static boolean isMagicSquare(int[][] matrix) {
// actual code omitted for the sake of simplicity.
}