Skip to content

Commit

Permalink
refactor: TimeSlot 수정사항 복원
Browse files Browse the repository at this point in the history
Co-authored-by: Go-Jaecheol <[email protected]>
  • Loading branch information
Choi-JJunho and Go-Jaecheol committed Aug 7, 2023
1 parent c75ad9e commit 25cbf2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public static void validateStartEndTime(final LocalTime startTime, final LocalTi
if (TimeUnit.cannotDivideByMinimumTimeUnit(startTime.getMinute())) {
throw new IllegalTimeUnitValueException(startTime.getMinute());
}

if (TimeUnit.cannotDivideByMinimumTimeUnit(endTime.getMinute())) {
throw new IllegalTimeUnitValueException(endTime.getMinute());
}
}

public boolean isNotDivisibleBy(final TimeUnit timeUnit) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void validateStartEndTime_endTimeEqualOrShorterThanStartTime(final LocalTime sta
}

@ParameterizedTest
@DisplayName("startTime이 5의 배수가 아니면 에러를 반환한다")
@DisplayName("startTime이나 endTime의 분 단위가 5의 배수가 아니면 에러를 반환한다")
@MethodSource("provideStartAndEndTime_notDivisibleByMinimumTimeUnit")
void validateStartEndTime_startTimeAndEndTimeNotDivisibleByMinimumTimeUnit(final LocalTime startTime, final LocalTime endTime) {
assertThatThrownBy(() -> TimeSlot.validateStartEndTime(startTime, endTime))
Expand Down Expand Up @@ -107,9 +107,9 @@ private static Stream<Arguments> provideStartAndEndTime_endTimeEqualOrShorterTha

private static Stream<Arguments> provideStartAndEndTime_notDivisibleByMinimumTimeUnit() {
return Stream.of(
Arguments.of(LocalTime.of(10, 1), LocalTime.of(10, 5)),
Arguments.of(LocalTime.of(10, 0), LocalTime.of(10, 1)),
Arguments.of(LocalTime.of(12, 4), LocalTime.of(12, 5)),
Arguments.of(LocalTime.of(13, 6), LocalTime.of(13, 10))
Arguments.of(LocalTime.of(13, 6), LocalTime.of(13, 11))
);
}

Expand Down

0 comments on commit 25cbf2f

Please sign in to comment.