Bug 466 - Error in output of CmdlistWarehouse 2
Summary: Error in output of CmdlistWarehouse 2
Status: CONFIRMED
Alias: None
Product: Warehouse Management System
Classification: Unclassified
Component: Testing V1 (show other bugs)
Version: Specified
Hardware: PC Windows
: High major
Assignee: ANIRUDH
URL:
Depends on:
Blocks:
 
Reported: 2020-11-25 02:46 HKT by ANIRUDH
Modified: 2020-11-25 02:46 HKT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ANIRUDH 2020-11-25 02:46:11 HKT
Steps to Reproduce:

1. First need to add a slot of size 2.
2. Secondly, need to add an item of size 1.
2. Next, need to run the command "listWarehouse"

Throwing an error: This test case is not showing the required output which is "Slot #1, volume is 1, free volume is 1"

Need to handle this error.

@Test 
	void testListWarehouse3 () { 
		ByteArrayOutputStream outContent = new ByteArrayOutputStream();
		System.setOut(new PrintStream(outContent));
		String nl = System.lineSeparator();
	    String cmdLine1 = "addSlot|2";
	    String [] cmdParts1 = cmdLine1.split("\\|");
	    (new CmdAddSlot()).execute(cmdParts1);
	    String cmdLine2 = "addItem|1";
	    String [] cmdParts2 = cmdLine2.split("\\|");
	    (new CmdAddItem()).execute(cmdParts2);
	    String cmdLine6 = "listWarehouse";
	    String [] cmdParts6 = cmdLine6.split("\\|");
		(new CmdListWarehouse()).execute(cmdParts6);
	    String expectedResults2 = "Slot #1, volume is 1, free volume is 1";
		assertEquals(expectedResults2, outContent.toString().trim().substring(outContent.toString().trim().lastIndexOf('\n')+1));
	}