Bug 440

Summary: Lack of the function to handle items that have expired delivery date.
Product: Warehouse Management System Reporter: Nurs <nzakirov2-c>
Component: TestingAssignee: ANIRUDH <pvsatavva2-c>
Status: CONFIRMED ---    
Severity: major CC: nzakirov2-c
Priority: ---    
Version: Specified   
Hardware: PC   
OS: Windows   

Description Nurs 2020-11-23 16:11:21 HKT
Note: The given problem is for Version 2.

Steps to reproduce:
1. Input items with a certain date
2. Make sure that the warehouse is full
3. Try to add an item with a starting date later than the delivery date of any present item in slots.

@Test
	void testMoveToSlot_05() {
		Warehouse wh =  Warehouse.getInstance();
		ArrayList<Slot> slots = new ArrayList<>();
		slots.add(new Slot(1));
		slots.add(new Slot(2));
		slots.add(new Slot(3));
		slots.add(new Slot(4));
		slots.add(new Slot(5));
		
		wh.setSlots(slots);
		
		Item item1 = new Item(1,new Day("13-Oct-2020"),new Day("20-Oct-2020"));
		Item item2 = new Item(2,new Day("13-Oct-2020"),new Day("19-Oct-2020"));
		Item item3 = new Item(3,new Day("13-Oct-2020"),new Day("20-Oct-2020"));
		Item item4 = new Item(4,new Day("13-Oct-2020"),new Day("20-Oct-2020"));
		Item item5 = new Item(5,new Day("13-Oct-2020"),new Day("20-Oct-2020"));
		
		Item newItem = new Item(2,new Day("21-Oct-2020"),new Day("27-Oct-2020"));

		boolean result = wh.testResult();
		String msg = "Checking when all items have expired and the warehouse is empty";
		assertEquals(true, result, msg);
	}

In the test case above, the Warehouse is full until October 20, 2020, and those items are expected to be delivered on this day. Therefore, on October 21, 2020, the warehouse should be empty and available for other items. However, when we try to add a new item, the program says that the Warehouse is full and can not process the item. Need to add a function to handle the delivery of items when they have expired.