Skip to content

Commit

Permalink
[test] Vendor 생성은 비밀번호를 8자부터 허용한다.
Browse files Browse the repository at this point in the history
`+` 패스워트 7/8글자 테스트 추가
  • Loading branch information
Dr-KoKo committed Aug 11, 2024
1 parent 3abdeb9 commit c92a634
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/test/java/camp/woowak/lab/vendor/domain/VendorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ void failWith101() {
@Nested
@DisplayName("비밀번호가")
class PasswordMust {
@Test
@DisplayName("[성공] 8자 이상부터 허용한다.")
void successWith8() {
Assertions.assertDoesNotThrow(
() -> new Vendor("aaaaaaaaaa", "validEmail@validEmail.com", "thisis8c",
"010-0000-0000", payAccount, passwordEncoder));
}

@Test
@DisplayName("[성공] 30자까지 허용한다.")
void successWith30() {
Expand All @@ -126,6 +134,14 @@ void failWithBlank() {
passwordEncoder));
}

@Test
@DisplayName("[예외] 8자 미만이면 예외가 발생한다.")
void failWith7() {
Assertions.assertThrows(InvalidCreationException.class,
() -> new Vendor("aaaaaaaaaa", "validEmail@validEmail.com", "thisis7",
"010-0000-0000", payAccount, passwordEncoder));
}

@Test
@DisplayName("[예외] 30자를 초과하면 예외가 발생한다.")
void failWith31() {
Expand Down

0 comments on commit c92a634

Please sign in to comment.