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

[1단계] - 학습 테스트 실습 #5877

Merged
merged 6 commits into from
Mar 11, 2025
Merged

Conversation

ParkSeryu
Copy link

이번 미션 잘 부탁 드립니다 ~

Copy link
Member

@nooose nooose left a comment

Choose a reason for hiding this comment

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

안녕하세요, 준형님
리뷰어 성준혁입니다. 😊

코멘트 남겼어요! 함께 잘해봐요!

Comment on lines +27 to +34
// given
int expected = 3;

// when
int sut = numbers.size();

// then
assertThat(sut).isEqualTo(expected);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// given
int expected = 3;
// when
int sut = numbers.size();
// then
assertThat(sut).isEqualTo(expected);
assertThat(numbers).hasSize(3);

이렇게도 사용해 보면 어떨까요?

@ParameterizedTest
@ValueSource(ints = {1, 2, 3})
void containsTest(int argument) {
assertThat(numbers.contains(argument)).isTrue();
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
assertThat(numbers.contains(argument)).isTrue();
assertThat(numbers).contains(argument);

String[] sut = str.split(",");

// then
assertAll(() -> assertThat(sut).contains("1", "2"), () -> assertThat(sut).containsExactly("1", "2"));
Copy link
Member

Choose a reason for hiding this comment

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

containsExactly 검증만으로 contains를 포함하고 있으니 contains 검증은 제거해도 좋습니다.

Suggested change
assertAll(() -> assertThat(sut).contains("1", "2"), () -> assertThat(sut).containsExactly("1", "2"));
assertThat(sut).containsExactly("1", "2");


public class StringTest {

@DisplayName("1,2를 ','로 split 했을 때 1과 2로 잘 분리되는지 확인한다.")
Copy link
Member

Choose a reason for hiding this comment

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

테스트 케이스 마다 설명이 잘 작성되어 있네요 👍

@nooose nooose merged commit ed5ce64 into next-step:parkseryu Mar 11, 2025
@ParkSeryu ParkSeryu deleted the parkseryu branch March 13, 2025 12:01
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