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

[REFACTOR] 테이블 명에 숫자를 허용하도록 수정 #67

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class ParliamentaryTable {

private static final String NAME_REGEX = "^[a-zA-Z가- ]+$";
private static final String NAME_REGEX = "^[a-zA-Z가-힣0-9 ]+$";
public static final int NAME_MAX_LENGTH = 20;

@Id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public enum ClientErrorCode implements ErrorCode {
),
INVALID_TABLE_NAME_FORM(
HttpStatus.BAD_REQUEST,
"테이블 이름은 영문/한글만 가능합니다"
"테이블 이름은 영문/한글/숫자/띄어쓰기만 가능합니다"
),
INVALID_TABLE_TIME(HttpStatus.BAD_REQUEST, "시간은 양수만 가능합니다"),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class ParliamentaryTableTest {
class Validate {

@ParameterizedTest
@ValueSource(strings = {"a bc가다", "가나 다ab"})
void 테이블_이름은_영문과_한글_띄어쓰기만_가능하다(String name) {
@ValueSource(strings = {"a bc가다9", "가0나 다ab"})
void 테이블_이름은_영문과_한글_숫자_띄어쓰기만_가능하다(String name) {
Member member = new Member("member");
assertThatCode(() -> new ParliamentaryTable(member, name, "agenda", 10))
.doesNotThrowAnyException();
Expand All @@ -42,7 +42,7 @@ class Validate {
}

@ParameterizedTest
@ValueSource(strings = {"abc12", "가나다12", "abc\tde"})
@ValueSource(strings = {"abc@", "가나다*", "abc\tde"})
void 허용된_글자_이외의_문자는_불가능하다(String name) {
Member member = new Member("member");
assertThatThrownBy(() -> new ParliamentaryTable(member, name, "agenda", 10))
Expand Down
Loading