Skip to content

Commit

Permalink
Write test for Person#deleteTask
Browse files Browse the repository at this point in the history
  • Loading branch information
chin-herng committed Mar 18, 2024
1 parent 335dfa2 commit c5ef6cc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/test/java/seedu/address/model/person/PersonTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import org.junit.jupiter.api.Test;

import seedu.address.model.task.Task;
import seedu.address.testutil.PersonBuilder;

public class PersonTest {
Expand All @@ -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
Expand Down

0 comments on commit c5ef6cc

Please sign in to comment.