Skip to content

Commit

Permalink
test: 행렬 곱 테스트 코드
Browse files Browse the repository at this point in the history
  • Loading branch information
rldnrl committed Oct 14, 2023
1 parent c1f680b commit 8eb8ed7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/programmers/lv2/MatrixMultiplyTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package programmers.lv2;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public class MatrixMultiplyTest {
@Test()
void solutionTest() {
MatrixMultiply matrixMultiply = new MatrixMultiply();
int[][] arr1 = {{1, 4}, {3, 2}, {4, 1}};
int[][] arr2 = {{3, 3}, {3, 3}};
int[][] answer1 = {{15, 15}, {15, 15}, {15, 15}};
Assertions.assertArrayEquals(matrixMultiply.solution(arr1, arr2), answer1);

int[][] arr3 = {{2, 3, 2}, {4, 2, 4}, {3, 1, 4}};
int[][] arr4 = {{5, 4, 3}, {2, 4, 1}, {3, 1, 1}};
int[][] answer2 = {{22, 22, 11}, {36, 28, 18}, {29, 20, 14}};
Assertions.assertArrayEquals(matrixMultiply.solution(arr3, arr4), answer2);

}
}

0 comments on commit 8eb8ed7

Please sign in to comment.