Bug 463 - Wrong output shown for a test Case of CmdAddSlot1
Summary: Wrong output shown for a test Case of CmdAddSlot1
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:36 HKT by ANIRUDH
Modified: 2020-11-25 02:36 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:36:47 HKT
Steps to Reproduce:

1. Set the date of adding the slot
2. Give the command addingSlot|1 instead of addSlot|1. (Invalid Command given)

Need to handle this error and throw an error message.
Showing output as "Error. The date is before or equals to the system date." instead of throwing Invalid Command.

Given test case:

@Test
void testAddNewSlot5() {
		ByteArrayOutputStream outContent = new ByteArrayOutputStream();
	    System.setOut(new PrintStream(outContent));
	    String dateSet = "setNewDay|13-Oct-2020";
	    String [] dateParts = dateSet.split("\\|");
	    (new CmdSetDate()).execute(dateParts);
	    String cmdLine = "addingSlot|1";
	    String [] cmdParts = cmdLine.split("\\|");
	    assertEquals("Invalid Command!", outContent.toString().trim().substring(outContent.toString().trim().lastIndexOf('\n')+1));
	}