From c5ef6cc5fe2a9c91ae4123eaf9b7940106d3bb8d Mon Sep 17 00:00:00 2001 From: Chong Chin Herng Date: Mon, 18 Mar 2024 20:55:07 +0800 Subject: [PATCH] Write test for Person#deleteTask --- src/test/java/seedu/address/model/person/PersonTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/java/seedu/address/model/person/PersonTest.java b/src/test/java/seedu/address/model/person/PersonTest.java index 33e55b141e2..f6e9a4d40e6 100644 --- a/src/test/java/seedu/address/model/person/PersonTest.java +++ b/src/test/java/seedu/address/model/person/PersonTest.java @@ -14,6 +14,7 @@ import org.junit.jupiter.api.Test; +import seedu.address.model.task.Task; import seedu.address.testutil.PersonBuilder; public class PersonTest { @@ -24,6 +25,12 @@ public void asObservableList_modifyList_throwsUnsupportedOperationException() { assertThrows(UnsupportedOperationException.class, () -> person.getTasks().remove(0)); } + @Test + public void deleteTask() { + Person person = new PersonBuilder().withTasks("prepare-presentation").build(); + assertEquals(new PersonBuilder().build(), person.deleteTask(new Task("prepare-presentation"))); + } + @Test public void isSamePerson() { // same object -> returns true