Bug 443

Summary: Exception Not Handled: Invalid Date
Product: Warehouse Management System Reporter: Nurs <nzakirov2-c>
Component: TestingAssignee: ANIRUDH <pvsatavva2-c>
Status: CONFIRMED ---    
Severity: critical CC: nzakirov2-c
Priority: ---    
Version: Specified   
Hardware: PC   
OS: Windows   

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

Steps to reproduce:
1. Initialize the warehouse
2. Add slots to an instance
3. Create an item with the invalid date and add it

Items with Invalid date should be denied and deleted from the program. In our case, the program does not deny the creation of such items. Moreover, it accepts them to the warehouse and puts them into slots. 

@Test
	void testMoveToSlot_10() {
		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("20-Oct-2020"));
		Item item3 = new Item(3,new Day("13-Oct-2020"),new Day("20-Oct-2020"));
		Item newItem = new Item(4,new Day("41-Oct-2020"),new Day("33-Oct-2020"));

		boolean result = wh.testResult();
		String msg = "Checking when arrival and departure dates are not valid";
		assertEquals(false, result, msg);
	}