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단계 - 문자열 계산기 #5657

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
afb3952
1단계 - 학습테스트 실습 (#5569)
kdfasdf Sep 24, 2024
7f59c4d
feat: implement requirement 1
kdfasdf Sep 26, 2024
a7c96bb
feat: implement requirement 2
kdfasdf Sep 27, 2024
e808659
feat: implement requirement 3
kdfasdf Sep 27, 2024
2724f87
implement requirement 4
kdfasdf Sep 27, 2024
7255cec
feat: implement requirement 5
kdfasdf Sep 27, 2024
d751a21
chore : rename file
kdfasdf Sep 27, 2024
81050ba
feat : implement requirement 6
kdfasdf Sep 27, 2024
a6163b7
chore : 미사용 파일 삭제 및 주석 추가
kdfasdf Sep 27, 2024
823b6cb
chore : 구현 내용 초기화
kdfasdf Sep 27, 2024
bedc9d1
feat : 요구사항1 구현
kdfasdf Sep 27, 2024
00b6c48
feat : 요구사항2 구현
kdfasdf Sep 27, 2024
4f9474d
feat : 요구사항 3 구현
kdfasdf Sep 27, 2024
7da8790
feat : 요구사항 4 구현
kdfasdf Sep 27, 2024
e557d7a
feat : 요구사항 5 구현
kdfasdf Sep 27, 2024
7415048
feat : 요구사항 6 구현
kdfasdf Sep 27, 2024
3fad8a6
chore : 상수추출 및 불필요한 메서드(validnegative) 제거
kdfasdf Sep 27, 2024
c8ea667
refactor : 숫자 합을 구하는 공통 로직, calculateSum 메서드로 추출
kdfasdf Sep 27, 2024
15b2371
chore : 불필요한 지역변수 제거
kdfasdf Sep 27, 2024
2249f09
refactor : if문 validNegativeNumberString메서드로 분리
kdfasdf Sep 27, 2024
188ea61
refactor : 정수 형변환 toInt()메서드로 책임 분리
kdfasdf Sep 27, 2024
8604a7e
chore : 코드 자동 정렬
kdfasdf Sep 27, 2024
3f0e234
refactor : 요구사항 1, 2 재구현 및 private() 생성자
kdfasdf Sep 28, 2024
639fcfc
refactor : 요구사항 3 재구현
kdfasdf Sep 28, 2024
4a4aa08
refactor : 요구사항 4 재구현
kdfasdf Sep 28, 2024
13c2117
refactor : 피드백 반영 및 요구사항 5 재구현
kdfasdf Sep 28, 2024
f9458c1
refactor : 요구사항 6 재구현 및 피드백 반영
kdfasdf Sep 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: implement requirement 3
  • Loading branch information
kdfasdf committed Sep 27, 2024
commit e8086598d10efdb7dccf0ec0ca46da062c8d252c
12 changes: 12 additions & 0 deletions src/test/java/StringAddCalculator.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,16 @@ void inputOneStringReturnToInteger(){
Assertions.assertThat(result).isEqualTo(1);
}

@Test
@DisplayName("숫자 두 개를 컴파(,) 구분자로 입력할 경우 두 숫자의 합을 반환한다")
void sumAndSplitWithComma(){
String str = "1,2";
String[] strs = str.split(",");
int result = 0;
for (String s : strs) {
result += Integer.parseInt(s);
}
Assertions.assertThat(result).isEqualTo(3);
}

}