

public class AppointmentBookRunner {

	public static void prepareDataForFindFreeBlock(AppointmentBook book)
	{
		book.reserveBlock(2, 0, 10);
		book.reserveBlock(2, 15, 15);
		book.reserveBlock(2, 45, 5);
	}
	
	public static void prepareDataForMakeAppointment(AppointmentBook book)
	{
		book.reserveBlock(2, 0, 25);
		book.reserveBlock(2, 30, 30);
		book.reserveBlock(3, 15, 26);
		book.reserveBlock(4, 0, 5);
		book.reserveBlock(4, 30, 14);
	}
	
	public static void main(String args[])
	{
		AppointmentBook book= new AppointmentBook();
		
		prepareDataForFindFreeBlock(book);
		
		System.out.print("Results after execution of book.findFreeBlock(2, 15): ");
		System.out.println(book.findFreeBlock(2, 15));
		System.out.println("----------------------------------");
		
		System.out.print("Results after execution of book.findFreeBlock(2, 9): ");
		System.out.println(book.findFreeBlock(2, 9));
		System.out.println("----------------------------------");
		
		System.out.print("Results after execution of book.findFreeBlock(2,20): ");
		System.out.println(book.findFreeBlock(2,20));
		System.out.println("----------------------------------");
		
		// creating new book with all free slots
		AppointmentBook book2= new AppointmentBook();
		
		prepareDataForMakeAppointment(book2);
		
		System.out.print("Results for makeAppointment(2, 4, 22): ");
		System.out.println(book2.makeAppointment(2, 4, 22));
		System.out.println("----------------------------------");
		
		System.out.print("Results for makeAppointment(3, 4, 3): ");
		System.out.println(book2.makeAppointment(3, 4, 3));
		System.out.println("----------------------------------");
		
		System.out.print("Results for makeAppointment(2, 4, 30): ");
		System.out.println(book2.makeAppointment(2, 4, 30));
		System.out.println("----------------------------------");
		
	}
}
