-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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단계 - 문자열 계산기 #5657
Open
kdfasdf
wants to merge
27
commits into
next-step:master
Choose a base branch
from
kdfasdf:step2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
2단계 - 문자열 계산기 #5657
+234
−0
Conversation
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
- when empty string or null is given return 0
- when a number is given as String return it as int
- use comma or colon as delieter
custom delimeter test
- StringAddCalculator to StringAddCalculatorTest (src/test/java)
- when negative number is given, RuntimeException is thrown
- give when then 주석 추가 (src/test/java/StringAddCalculatorTest) - .gitkeep 파일 제거 (src/main/java)
- 빈 문자열 또는 null 이면 0을 반환
- 숫자 하나 입력할 경우 해당 숫자 반환
- 숫자 두개를 컴마 구분자로 입력할 경우 두 숫자의 합 반환
- 구분자를 컴마 이외에 콜론을 사용할 수 있다 - 사용되지 않는 import 구문 제거
- 커스텀 구분자 사용를 지정할 수 있다
- 음수를 전달할 경우 RuntimeException 예외가 발생해야 한다
- splitAndSumWithComma (src/main/java) - splitAndSumWithCommaOrColon (src/main/java) - splitWithCustomDelimeter (src/main/java)
- negativeValidation (src/main/java/StringAddCalculator.class)
- calculateSum(src/main/java/StringAddCalculator.class)
- 아래 메서드들을 splitAndSum에 재구현 - emptyOrNull - processOneNumberString
- splitAndSumWithComma를 splitAndSum에 구현
- Pattern 객체 상수로 추출 - splitWithCustomDelimeter 기능을 splitAndSum에 통합
- StringAddCalculator.java (src/main/java) - negativeValidation()을 splitAndSum()에 기능 통합 - calculateSum()에 isNegative() 추가
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
안녕하세요 리뷰어님!
피드백 확인 후 반영해보았습니다. 리뷰 다시 요청드립니다!!
감사합니다.