Skip to content

Commit

Permalink
test: add test code
Browse files Browse the repository at this point in the history
  • Loading branch information
rldnrl committed Oct 6, 2023
1 parent 0ed3636 commit 0d41941
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/programmers/lv2/TriangleSnailTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package programmers.lv2;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import programmers.lv2.TriangleSnail;

public class TriangleSnailTest {
@Test
void solutionTest() {
int input1 = 4;
int[] result1 = new int[]{1,2,9,3,10,8,4,5,6,7};
Assertions.assertArrayEquals(TriangleSnail.solution(input1), result1);

int input2 = 5;
int[] result2 = new int[]{1,2,12,3,13,11,4,14,15,10,5,6,7,8,9};
Assertions.assertArrayEquals(TriangleSnail.solution(input2), result2);

int input3 = 6;
int[] result3 = new int[]{1,2,15,3,16,14,4,17,21,13,5,18,19,20,12,6,7,8,9,10,11};
Assertions.assertArrayEquals(TriangleSnail.solution(input3), result3);
}
}

0 comments on commit 0d41941

Please sign in to comment.