Skip to content

Commit ba06e3d

Browse files
committed
refactor: 테스트가 가능하도록 간선정보 반환을 String으로 하도록 변경
1 parent 4160b22 commit ba06e3d

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

yoonexample/src/main/java/graph/Graph.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public interface Graph {
1616
void addEdge(int fromV, int toV);
1717

1818
/**
19-
* 그래프의 간선정보를 출력합니다.
19+
* 그래프의 간선정보를 반환합니다.
2020
*/
21-
void showGraphEdgeInfo();
21+
String showGraphEdgeInfo();
2222
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package graph;
2+
3+
import static org.assertj.core.api.Assertions.assertThat;
4+
5+
import org.junit.jupiter.api.BeforeEach;
6+
import org.junit.jupiter.api.Test;
7+
8+
class GraphTest {
9+
10+
Graph graph;
11+
12+
@BeforeEach
13+
void setUp() {
14+
graph = new ListGrpah(5);
15+
}
16+
17+
@Test
18+
void 그래프_초기화_테스트() {
19+
assertThat(graph).isNotNull();
20+
}
21+
22+
@Test
23+
void 그래프_정점_연결_테스트() {
24+
graph.addEdge();
25+
}
26+
}

0 commit comments

Comments
 (0)