Skip to content

Commit

Permalink
added deletion test for no unique name match found error message enfo…
Browse files Browse the repository at this point in the history
…rcement
  • Loading branch information
AHaliq committed Oct 13, 2016
1 parent 8090f99 commit 2c9699d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/java/seedu/address/logic/LogicManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,27 @@ public void execute_deleteIndexNotFound_errorMessageShown() throws Exception {
assertIndexNotFoundBehaviorForCommand("delete");
}

/** Confirms the 'invalid argument name behavior' for the delete command
* @throws Exception
*/
@Test
public void execute_deleteUniqueNameNotFound_errorMessageShown() throws Exception {
String expectedMessage = MESSAGE_INVALID_TASK_NAME_SEARCH;
TestDataHelper helper = new TestDataHelper();
List<Task> taskList = helper.generateTaskList(3);

// extract one task out of task list state
Task removedTask = taskList.remove(0);

// set task list state
model.resetData(new AddressBook());
for (Task p : taskList) {
model.addTask(p);
}

assertCommandBehavior("delete " + removedTask.getName().taskName, expectedMessage, model.getAddressBook(), taskList);
}

@Test
public void execute_delete_removesCorrectTask() throws Exception {
TestDataHelper helper = new TestDataHelper();
Expand Down

0 comments on commit 2c9699d

Please sign in to comment.