You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[#855] Refactor PersonBuilder constructor to use TypicalPersons as argument (#889)
When creating a Person for testing, some tests specify almost all of
the fields of an existing TypicalPerson, with only a slight variation
in one or two fields. For example, the code below builds on top of
TypicalPerson#AMY with only changes to address and tags:
toAdd = new PersonBuilder().withName(VALID_NAME_AMY).withPhone(VALID_PHONE_AMY)
.withEmail(VALID_EMAIL_AMY).withAddress(VALID_ADDRESS_BOB)
.withTags(VALID_TAG_FRIEND).build();
This is long-winded and unnecessary, as PersonBuilder allows us to start
from a ready-made Person, and modify as necessary. For example, the code
above can be refactored to:
toAdd = new PersonBuilder(AMY).withAddress(VALID_ADDRESS_BOB).build();
Let's refactor the calls to PersonBuilder to make them more concise.
0 commit comments