Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

๐Ÿš€ 2๋‹จ๊ณ„ - ์š”๊ธˆ ์กฐํšŒ #482

Open
wants to merge 3 commits into
base: seonje1
Choose a base branch
from

Conversation

seonje1
Copy link

@seonje1 seonje1 commented Mar 13, 2024

No description provided.

Copy link

@bactoria bactoria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์„ ์ œ๋‹˜ ์•ˆ๋…•ํ•˜์„ธ์š”! ๐Ÿ˜€
์ด๋ฒˆ ๋‹จ๊ณ„ ์ž˜ ๊ตฌํ˜„ ํ•ด์ฃผ์…จ๋Š”๋ฐ์š”.

์ด๋ฒˆ ๋‹จ๊ณ„์˜ ์š”๊ตฌ์‚ฌํ•ญ์— ๋ˆ„๋ฝ๋œ ๋ถ€๋ถ„์ด ์žˆ์–ด,
์ฝ”๋ฉ˜ํŠธ ์ฐธ๊ณ ํ•˜์‹œ์–ด ๋ฐ˜์˜ํ•ด ์ฃผ์„ธ์š”! ๐Ÿ’ช ๐Ÿ’ช

@@ -37,11 +37,11 @@ public PathResponse getPath(List<Sections> sectionsList, Station sourceStation,
.map(StationResponse::ofEntity)
.collect(Collectors.toList()),
distance,
duration
duration,
FareCalculator.calculate(distance)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ง€ํ•˜์ฒ  ์š”๊ธˆ์€ ์ตœ๋‹จ๊ฑฐ๋ฆฌ ๊ธฐ์ค€์œผ๋กœ ๋ถ€๊ณผํ•˜๋Š” ๊ฒƒ์ด ์ •์ฑ…์ธ๋ฐ์š”.
ํ˜„์žฌ ์ถœ๋ฐœ์—ญ/๋„์ฐฉ์—ญ์ด ๊ฐ™๋”๋ผ๋„ ์กฐํšŒํ•˜๋Š” ๊ฒฝ๋กœ ํƒ€์ž…์— ๋”ฐ๋ผ ์š”๊ธˆ์ด ๋‹ฌ๋ผ์ง€๋Š” ๊ฒƒ ๊ฐ™์•„ ์ˆ˜์ •์ด ํ•„์š” ํ•ด ๋ณด์—ฌ์š”.

CleanShot 2024-03-16 at 12 29 11@2x

this.stations = stations;
this.distance = distance;
this.duration = duration;
this.fare = fare;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ํ˜„์žฌ ๊ฒฝ๋กœ๋ฅผ ๊ตฌํ•  ๋•Œ ์‘๋‹ต์œผ๋กœ ์š”๊ธˆ์„ ํ•จ๊ป˜ ๊ณ„์‚ฐํ•˜์—ฌ ๋ฐ˜ํ™˜ํ•˜๊ณ  ์žˆ๋„ค์š”.

์š”๊ธˆ์„ ๊ณ„์‚ฐํ•˜๋Š” ์—ญํ• ์€ ๊ฒฝ๋กœ๋ฅผ ์ฐพ๋Š” PathFinder ์— ๋‘๊ธฐ์—๋Š” ๊ณผํ•œ ์ฑ…์ž„์„ ๋ถ€๊ณผํ•œ ๊ฒƒ ์œผ๋กœ ๋ณด์—ฌ์ ธ์š”.

๊ฑฐ๋ฆฌ๋ฅผ ์ด์šฉํ•˜์—ฌ ์š”๊ธˆ์„ ๊ณ„์‚ฐํ•˜๋Š” ํด๋ž˜์Šค๋ฅผ ๋งŒ๋“ค์–ด ๋ฆฌํŒฉํ† ๋ง ํ•ด๋ณด๋ฉด ์–ด๋–จ๊นŒ์š”? ๐Ÿ˜Š

Comment on lines +98 to +103
/**
* Given ์ง€ํ•˜์ฒ  ๊ตฌ๊ฐ„์„ ๋“ฑ๋กํ•˜๊ณ 
* When ๊ฒฝ๋กœ๋ฅผ ์กฐํšŒํ•˜๋ฉด
* Then ์ถœ๋ฐœ์—ญ๊ณผ ๋„์ฐฉ์—ญ๊นŒ์ง€์˜ ์š”๊ธˆ์„ ์กฐํšŒํ•œ๋‹ค
*/
@DisplayName("์ถœ๋ฐœ์—ญ๊ณผ ๋„์ฐฉ์—ญ๊นŒ์ง€์˜ ์š”๊ธˆ ์กฐํšŒ")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ธ์ˆ˜ํ…Œ์ŠคํŠธ๋ฅผ ์ž˜ ์ž‘์„ฑ ํ•ด ์ฃผ์…จ๋„ค์š” ๐Ÿ‘
ํ์ปด๋ฒ„๋ฅผ ์ด์šฉํ•œ ์ธ์ˆ˜ํ…Œ์ŠคํŠธ๊ฐ€ ์š”๊ตฌ์‚ฌํ•ญ์— ์กด์žฌํ•˜๋Š”๋ฐ์š”!
ํ์ปด๋ฒ„๋ฅผ ์ด์šฉํ•ด์„œ ๋งŒ๋“ค์–ด๋ณด๋Š” ๊ฑด ์–ด๋–จ๊นŒ์š”?

CleanShot 2024-03-16 at 12 52 07@2x

public class FareCalculator {

private static final int BASE_FARE = 1250;
private static final int OVER_50KM_FARE = 2150;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SURCHARGE ๊ฐ€ ๋ณ€๊ฒฝ๋œ๋‹ค๋ฉด OVER_50KM_FARE ๋„ ๋ณ€๊ฒฝ์ด ํ•„์š”ํ•˜๊ฒ ๋„ค์š”.
์ด๋Š” ์œ ์ง€๋ณด์ˆ˜์— ์ทจ์•ฝํ•  ์ˆ˜ ์žˆ์–ด๋ณด์ด์ง€๋งŒ, ๋‹จ์œ„ํ…Œ์ŠคํŠธ๋ฅผ ๋งŒ๋“ค์–ด์ฃผ์…”์„œ ์ง€๊ธˆ๋„ ๊ดœ์ฐฎ์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!

(๊ฐœ์ธ์ ์œผ๋กœ๋Š” ๋‹จ์œ„ํ…Œ์ŠคํŠธ๋ฅผ ๋”์šฑ ๊ผผ๊ผผํ•˜๊ฒŒ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด @ParameterizedTest ๋ฅผ ์ด์šฉํ•˜์—ฌ ๋”์šฑ ์„ธ์„ธํ•˜๊ฒŒ ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค๋ฅผ ์ถ”๊ฐ€ํ–ˆ์„ ๊ฒƒ ๊ฐ™์•„์š”)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants