| Summary: | Wrong output shown for a test Case of CmdAddSlot1 | ||
|---|---|---|---|
| Product: | Warehouse Management System | Reporter: | ANIRUDH <pvsatavva2-c> |
| Component: | Testing V1 | Assignee: | ANIRUDH <pvsatavva2-c> |
| Status: | CONFIRMED --- | ||
| Severity: | major | ||
| Priority: | High | ||
| Version: | Specified | ||
| Hardware: | PC | ||
| OS: | Windows | ||
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)); }