add tests for postavailability and reservation summary
This commit is contained in:
		@ -41,6 +41,17 @@ func (m *testDBRepo) SearchAvailabilityByDatesByRoomID(start, end time.Time, roo
 | 
			
		||||
// SearchAvailabilityForAllRooms returns a slice of rooms, if any, for given date range
 | 
			
		||||
func (m *testDBRepo) SearchAvailabilityForAllRooms(start, end time.Time) ([]models.Room, error) {
 | 
			
		||||
	var rooms []models.Room
 | 
			
		||||
	if start.Format("2006-01-02") == "2050-01-01" && end.Format("2006-01-02") == "2050-01-02" {
 | 
			
		||||
		room := models.Room{
 | 
			
		||||
			RoomName: "room",
 | 
			
		||||
			ID:       1,
 | 
			
		||||
		}
 | 
			
		||||
		rooms = append(rooms, room)
 | 
			
		||||
		return rooms, nil
 | 
			
		||||
	}
 | 
			
		||||
	if start.Format("2006-01-02") == "2050-01-03" && end.Format("2006-01-02") == "2050-01-04" {
 | 
			
		||||
		return rooms, errors.New("deliberate error")
 | 
			
		||||
	}
 | 
			
		||||
	return rooms, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user