forked from nus-cs2103-AY2425S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test coverage for assertion test
- Loading branch information
Showing
3 changed files
with
92 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ public class PersonBuilder { | |
public static final String DEFAULT_EMAIL = "[email protected]"; | ||
public static final String DEFAULT_ADDRESS = "123 Jurong West Ave 6 #08-111"; | ||
public static final String DEFAULT_COMMENT = "She likes fast delivery."; | ||
public static final boolean DEFAULT_IS_VIP = false; | ||
|
||
private Name name; | ||
private Phone phone; | ||
|
@@ -41,7 +42,7 @@ public PersonBuilder() { | |
address = new Address(DEFAULT_ADDRESS); | ||
comment = new Comment(DEFAULT_COMMENT); | ||
tags = new HashSet<>(); | ||
isVip = false; | ||
isVip = DEFAULT_IS_VIP; | ||
} | ||
|
||
/** | ||
|
@@ -66,7 +67,7 @@ public PersonBuilder withName(String name) { | |
} | ||
|
||
/** | ||
* Parses the {@code tags} into a {@code Set<Tag>} and set it to the {@code Person} that we are building. | ||
* Parses the {@code tags} into a {@code Set<Tag>} and sets it to the {@code Person} that we are building. | ||
*/ | ||
public PersonBuilder withTags(String ... tags) { | ||
this.tags = SampleDataUtil.getTagSet(tags); | ||
|
@@ -98,21 +99,24 @@ public PersonBuilder withEmail(String email) { | |
} | ||
|
||
/** | ||
* Sets the {@code isVip} of the {@code Person} that we are building. | ||
* Sets the {@code Comment} of the {@code Person} that we are building. | ||
*/ | ||
public PersonBuilder withVipState(boolean isVip) { | ||
this.isVip = isVip; | ||
public PersonBuilder withComment(String comment) { | ||
this.comment = new Comment(comment); | ||
return this; | ||
} | ||
|
||
/** | ||
* Sets the {@code Comment} of the {@code Person} that we are building. | ||
* Sets the {@code isVip} state of the {@code Person} that we are building. | ||
*/ | ||
public PersonBuilder withComment(String comment) { | ||
this.comment = new Comment(comment); | ||
public PersonBuilder withVipState(boolean isVip) { | ||
this.isVip = isVip; | ||
return this; | ||
} | ||
|
||
/** | ||
* Builds and returns a {@code Person} object with the specified attributes. | ||
*/ | ||
public Person build() { | ||
return new Person(name, phone, email, address, comment, tags, isVip); | ||
} | ||
|