Skip to content

Commit

Permalink
Fix nits
Browse files Browse the repository at this point in the history
  • Loading branch information
prokarius committed Oct 25, 2018
1 parent 123bbbc commit 3fdf653
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import seedu.address.model.loan.Email;
import seedu.address.model.loan.Loan;
import seedu.address.model.loan.LoanRate;
import seedu.address.model.loan.LoanTime;
import seedu.address.model.loan.Name;
import seedu.address.model.loan.Nric;
import seedu.address.model.loan.Phone;
Expand Down
21 changes: 14 additions & 7 deletions src/test/java/seedu/address/model/loan/LoanTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,33 +63,40 @@ public void isSameLoan() {
assertTrue(ALICE.isSame(editedAlice));

// same identity fields, same email, different attributes -> returns true
editedAlice = new LoanBuilder(ALICE).withPhone(VALID_PHONE_BOB).withAddress(VALID_ADDRESS_BOB)
editedAlice = new LoanBuilder(ALICE).withPhone(VALID_PHONE_BOB)
.withAddress(VALID_ADDRESS_BOB)
.withTags(VALID_TAG_HUSBAND).build();
assertTrue(ALICE.isSame(editedAlice));

// same identity fields, same phone, same email, different attributes -> returns true
editedAlice = new LoanBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).withTags(VALID_TAG_HUSBAND).build();
editedAlice = new LoanBuilder(ALICE).withAddress(VALID_ADDRESS_BOB)
.withTags(VALID_TAG_HUSBAND).build();
assertTrue(ALICE.isSame(editedAlice));

// same identity fields, different rate -> returns true
editedAlice = new LoanBuilder(ALICE).withLoanRate(VALID_LOANRATE_BOB).withTags(VALID_TAG_HUSBAND).build();
editedAlice = new LoanBuilder(ALICE).withLoanRate(VALID_LOANRATE_BOB)
.withTags(VALID_TAG_HUSBAND).build();
assertTrue(ALICE.isSame(editedAlice));

// same identity fields, different startTime -> returns true
editedAlice = new LoanBuilder(ALICE).withLoanStartTime(VALID_LOANSTARTTIME_BOB).withTags(VALID_TAG_HUSBAND).build();
editedAlice = new LoanBuilder(ALICE).withLoanStartTime(VALID_LOANSTARTTIME_BOB)
.withTags(VALID_TAG_HUSBAND).build();
assertTrue(ALICE.isSame(editedAlice));

// same identity fields, different endtime -> returns true
editedAlice = new LoanBuilder(ALICE).withLoanEndTime(VALID_LOANSTARTTIME_BOB).withTags(VALID_TAG_HUSBAND).build();
editedAlice = new LoanBuilder(ALICE).withLoanEndTime(VALID_LOANSTARTTIME_BOB)
.withTags(VALID_TAG_HUSBAND).build();
assertTrue(ALICE.isSame(editedAlice));

// same identity fields, different rate and startTime -> returns true
editedAlice = new LoanBuilder(ALICE).withLoanRate(VALID_LOANRATE_BOB).withLoanStartTime(VALID_LOANSTARTTIME_BOB)
editedAlice = new LoanBuilder(ALICE).withLoanRate(VALID_LOANRATE_BOB)
.withLoanStartTime(VALID_LOANSTARTTIME_BOB)
.withTags(VALID_TAG_HUSBAND).build();
assertTrue(ALICE.isSame(editedAlice));

// same identity fields, different rate and endTime -> returns true
editedAlice = new LoanBuilder(ALICE).withLoanRate(VALID_LOANRATE_BOB).withLoanEndTime(VALID_LOANSTARTTIME_BOB)
editedAlice = new LoanBuilder(ALICE).withLoanRate(VALID_LOANRATE_BOB)
.withLoanEndTime(VALID_LOANSTARTTIME_BOB)
.withTags(VALID_TAG_HUSBAND).build();
assertTrue(ALICE.isSame(editedAlice));
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/seedu/address/testutil/TypicalLoans.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import static seedu.address.logic.commands.CommandTestUtil.VALID_BIKE_BOB;
import static seedu.address.logic.commands.CommandTestUtil.VALID_EMAIL_AMY;
import static seedu.address.logic.commands.CommandTestUtil.VALID_EMAIL_BOB;
import static seedu.address.logic.commands.CommandTestUtil.VALID_LOANENDTIME_AMY;
import static seedu.address.logic.commands.CommandTestUtil.VALID_LOANENDTIME_BOB;
import static seedu.address.logic.commands.CommandTestUtil.VALID_LOANRATE_AMY;
import static seedu.address.logic.commands.CommandTestUtil.VALID_LOANRATE_BOB;
import static seedu.address.logic.commands.CommandTestUtil.VALID_LOANSTARTTIME_AMY;
import static seedu.address.logic.commands.CommandTestUtil.VALID_LOANSTARTTIME_BOB;
import static seedu.address.logic.commands.CommandTestUtil.VALID_LOANENDTIME_AMY;
import static seedu.address.logic.commands.CommandTestUtil.VALID_LOANENDTIME_BOB;
import static seedu.address.logic.commands.CommandTestUtil.VALID_NAME_AMY;
import static seedu.address.logic.commands.CommandTestUtil.VALID_NAME_BOB;
import static seedu.address.logic.commands.CommandTestUtil.VALID_NRIC_AMY;
Expand Down

0 comments on commit 3fdf653

Please sign in to comment.