@Test public void testValidEdit() throws CommandException, ApplicationErrorException { String commandArgs = "vmid1 \'New name\' 536870912 1"; String id = "vmid1"; String name = "New name"; long memory = 536870912; int numberOfCPU = 1; command.proceed(commandArgs, record, logger); assertTrue(record.containsID(id)); assertEquals(name, record.getVMRecord(id).getVM().getName()); assertEquals(memory, record.getVMRecord(id).getVM().getMemory()); assertEquals(numberOfCPU, record.getVMRecord(id).getVM().getNumberOfCPU()); }
@Test(expected = ApplicationErrorException.class) public void testInvalidDeleteCommandNotFoundID() throws CommandException, ApplicationErrorException { String commandArgs = "vmid3"; command.proceed(commandArgs, record, logger); }
@Test(expected = ApplicationErrorException.class) public void testInvalidCommandArgs() throws CommandException, ApplicationErrorException { String commandArgs = "vmid1 \'New name\' 536870912"; command.proceed(commandArgs, record, logger); }