Bug 464 - Wrong output shown for a test Case of CmdAddSlot 2
Summary: Wrong output shown for a test Case of CmdAddSlot 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:38 HKT by ANIRUDH
Modified: 2020-11-25 02:38 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:38:54 HKT
Steps to Reproduce:

1. Give the command addSlot|0

Error: When input given is 0, there is a conflict between the error messages, Ivalid slot input & Volume Out of Range!!

Need to handle this error.

Given test case:


@Test //When input given is 0, there is a conflict between the error messages, Ivalid slot input & Volume Out of Range!!
	void testAddNewSlot6() {
		ByteArrayOutputStream outContent = new ByteArrayOutputStream();
	    System.setOut(new PrintStream(outContent));
	    
	    String cmdLine = "addSlot|0";
	    String [] cmdParts = cmdLine.split("\\|");
	    (new CmdAddSlot()).execute(cmdParts);

	    //String msg = "Checking when the size of the item is less than 1";
	    assertEquals("Volume Out Of Range. The size can only be (1-100).", outContent.toString().trim().substring(outContent.toString().trim().lastIndexOf('\n')+1));
	}