forked from techeer-sv/Infinite_Challenge_BE
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package subway; | ||
|
||
public class SubwayService { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package subway; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Nested; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
public class SubwayServiceTest { | ||
|
||
@Nested | ||
@DisplayName("SubwayService Initialization") | ||
class SubwayService_Init { | ||
SubwayService subwayService; | ||
|
||
@BeforeEach | ||
void setUp() { | ||
subwayService = new SubwayService(); | ||
} | ||
|
||
@Test | ||
@DisplayName("지하철 노선도 초기화") | ||
void initSubwayLine() { | ||
subwayService.initSubwayLine(); | ||
|
||
assertAll( | ||
() -> assertEquals(Arrays.asList("교대역", "강남역", "역삼역"), subwayService.getStations("2호선")), | ||
() -> assertEquals(Arrays.asList("교대역", "남부터미널역", "양재역", "매봉역"), subwayService.getStations("3호선")), | ||
() -> assertEquals(Arrays.asList("강남역", "양재역", "양재시민의숲역"), subwayService.getStations("신분당선")) | ||
); | ||
} | ||
} | ||
} |