From 9036cefc0b4e0d2f6fd7be6a34e14751f635c089 Mon Sep 17 00:00:00 2001 From: alexchong711 Date: Tue, 29 Jan 2019 21:25:08 +0800 Subject: [PATCH 1/3] test des --- src/seedu/addressbook/storage/StorageFile.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/seedu/addressbook/storage/StorageFile.java b/src/seedu/addressbook/storage/StorageFile.java index 459632e67..61fa17f95 100644 --- a/src/seedu/addressbook/storage/StorageFile.java +++ b/src/seedu/addressbook/storage/StorageFile.java @@ -34,7 +34,7 @@ public class StorageFile { */ /** - * Signals that the given file path does not fulfill the storage filepath constraints. + * Signals that the given file path does not fulfill the storage filepath constraints.. */ public static class InvalidStorageFilePathException extends IllegalValueException { public InvalidStorageFilePathException(String message) { From 1e71e04455850df0aed882d4f749d1dfb2c09704 Mon Sep 17 00:00:00 2001 From: alexchong711 Date: Wed, 30 Jan 2019 12:32:23 +0800 Subject: [PATCH 2/3] AddressBook.java: added default person peter. AddressBookTest.java: tests default person peter --- src/seedu/addressbook/data/AddressBook.java | 15 ++++++++++++--- .../seedu/addressbook/data/AddressBookTest.java | 7 ++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/seedu/addressbook/data/AddressBook.java b/src/seedu/addressbook/data/AddressBook.java index a99a92f9f..b95389a84 100644 --- a/src/seedu/addressbook/data/AddressBook.java +++ b/src/seedu/addressbook/data/AddressBook.java @@ -5,9 +5,7 @@ import java.util.Map; import java.util.Set; -import seedu.addressbook.data.person.Person; -import seedu.addressbook.data.person.ReadOnlyPerson; -import seedu.addressbook.data.person.UniquePersonList; +import seedu.addressbook.data.person.*; import seedu.addressbook.data.person.UniquePersonList.DuplicatePersonException; import seedu.addressbook.data.person.UniquePersonList.PersonNotFoundException; import seedu.addressbook.data.tag.Tag; @@ -31,6 +29,17 @@ public class AddressBook { public AddressBook() { allPersons = new UniquePersonList(); allTags = new UniqueTagList(); + Tag tagScientist = new Tag("scientist"); + Person peter = new Person(new Name("Peter"), + new Phone("98121265", false), + new Email("peter@nusgdg.org", false), + new Address("15 Science Drive", false), + new UniqueTagList(tagScientist)); + try { + addPerson(peter); + } catch (DuplicatePersonException e) { + e.printStackTrace(); + } } /** diff --git a/test/java/seedu/addressbook/data/AddressBookTest.java b/test/java/seedu/addressbook/data/AddressBookTest.java index 79808d80b..9a8fde47e 100644 --- a/test/java/seedu/addressbook/data/AddressBookTest.java +++ b/test/java/seedu/addressbook/data/AddressBookTest.java @@ -119,7 +119,12 @@ public void addPerson_personAlreadyInListButHasTagNotInList_tagNotAdded() throws @Test public void containsPerson() throws Exception { - UniquePersonList personsWhoShouldBeIn = new UniquePersonList(aliceBetsy, bobChaplin); + Person peter = new Person(new Name("Peter"), + new Phone("98121265", false), + new Email("peter@nusgdg.org", false), + new Address("15 Science Drive", false), + new UniqueTagList(tagScientist)); + UniquePersonList personsWhoShouldBeIn = new UniquePersonList(aliceBetsy, bobChaplin, peter); UniquePersonList personsWhoShouldNotBeIn = new UniquePersonList(charlieDouglas, davidElliot); for (Person personWhoShouldBeIn : personsWhoShouldBeIn) { From 1da082ae2347bf82561e250b8b93a5c36c27381a Mon Sep 17 00:00:00 2001 From: alexchong711 Date: Wed, 30 Jan 2019 12:40:46 +0800 Subject: [PATCH 3/3] UserGuide.md: added information about default peter added --- doc/UserGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/UserGuide.md b/doc/UserGuide.md index fcd5a7121..c2d761e41 100644 --- a/doc/UserGuide.md +++ b/doc/UserGuide.md @@ -34,7 +34,7 @@ Format: `help` > Help is also shown if you enter an incorrect command e.g. `abcd` ### Adding a person: `add` -Adds a person to the address book
+Adds a person to the address book. Peter by default is already added.
Format: `add NAME [p]p/PHONE_NUMBER [p]e/EMAIL [p]a/ADDRESS [t/TAG]...` > Words in `UPPER_CASE` are the parameters, items in `SQUARE_BRACKETS` are optional,