add tests for availabilityJson

This commit is contained in:
2024-07-14 14:51:12 +02:00
parent 413bfc1685
commit 904ee95d63
3 changed files with 133 additions and 31 deletions

View File

@ -29,7 +29,10 @@ func (m *testDBRepo) InsertRoomRestriction(r models.RoomRestriction) error {
// SearchAvailabilityByDatesByRoomID returns true if availability exists for roomID, and false if no availability
func (m *testDBRepo) SearchAvailabilityByDatesByRoomID(start, end time.Time, roomID int) (bool, error) {
return false, nil
if roomID == 2 {
return false, errors.New("deliberate error")
}
return true, nil
}
// SearchAvailabilityForAllRooms returns a slice of rooms, if any, for given date range