diff --git a/src/test/java/com/catspot/service/TimeTableServiceTest.java b/src/test/java/com/catspot/service/TimeTableServiceTest.java index bc1a011..2b7ba7e 100644 --- a/src/test/java/com/catspot/service/TimeTableServiceTest.java +++ b/src/test/java/com/catspot/service/TimeTableServiceTest.java @@ -1,6 +1,7 @@ package com.catspot.service; import com.catspot.dto.response.TimeTableGetResponse; +import com.catspot.exceptionhandler.CustomException; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @@ -23,4 +24,26 @@ class TimeTableServiceTest { assertEquals("N113", response.getClassName()); System.out.println("response = " + response.getClassName()); } + + @Test + void testGetTimeTableList_InvalidBuildingName() { + String buildingName = ""; + int classroomNumber = 303; + String day = "Monday"; + + assertThrows(CustomException.class, () -> { + timeTableService.getTimeTableList(buildingName, classroomNumber, day); + }); + } + + @Test + void testGetTimeTableList_InvalidClassroomNumber() { + String buildingName = "A"; + int classroomNumber = -1; // 유효하지 않은 강의실 번호 + String day = "Monday"; + + assertThrows(CustomException.class, () -> { + timeTableService.getTimeTableList(buildingName, classroomNumber, day); + }); + } }