Skip to content

Commit

Permalink
Merge pull request #88 from Joseph31416/add_assert
Browse files Browse the repository at this point in the history
Loan.java: Add assert statements
  • Loading branch information
kjw142857 authored Apr 1, 2024
2 parents 939ccb9 + de88f12 commit 4d7a156
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/seedu/address/model/person/Loan.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public class Loan implements Comparable<Loan> {
*/
public Loan(int id, float value, Date startDate, Date returnDate, Person assignee) {
requireAllNonNull(id, value, startDate, returnDate, assignee);
assert isValidValue(value);
assert id >= 0;
this.id = id;
this.value = value;
this.startDate = startDate;
Expand All @@ -55,6 +57,8 @@ public Loan(int id, float value, Date startDate, Date returnDate, Person assigne
*/
public Loan(int id, float value, Date startDate, Date returnDate, boolean isReturned, Person assignee) {
requireAllNonNull(id, value, startDate, returnDate, isReturned, assignee);
assert isValidValue(value);
assert id >= 0;
this.id = id;
this.value = value;
this.startDate = startDate;
Expand Down

0 comments on commit 4d7a156

Please sign in to comment.