Skip to content

Commit

Permalink
Fix style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cadencjk committed Oct 16, 2022
1 parent d422cfd commit ec5b6ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/main/java/seedu/address/model/person/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ public boolean isSamePerson(Person otherPerson) {
}

/**
* Determines whether the person owes money.
* Determines whether the person is owing money.
*
* @return true if the person owes money
* @return true if the person is owing money
*/
public boolean owesMoney() {
public boolean isOwingMoney() {
return moneyOwed.isGreaterThanZero();
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/seedu/address/ui/ScheduleCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
public class ScheduleCard extends UiPart<Region> {

private static final String FXML = "ScheduleListCard.fxml";

private static final String COLOUR_OF_DEBTOR = "-fx-text-fill: #FF0000;";

/**
Expand Down Expand Up @@ -56,7 +55,7 @@ public ScheduleCard(Person person, int displayedIndex) {
* @param person to check whether he/she is a debtor
*/
private void setWarningIfOwed(Person person) {
if (person.owesMoney()) {
if (person.isOwingMoney()) {
String nameWithAmount = person.getName().fullName + " - To collect $" + person.getMoneyOwed().value;
name.setText(nameWithAmount);
name.setStyle(COLOUR_OF_DEBTOR);
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/seedu/address/model/person/PersonTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ public void execute_setClassSuccess() {
@Test
public void owesMoneyTest() {
Person debtor = AVA;
assertTrue(debtor.owesMoney());
assertTrue(debtor.isOwingMoney());

Person nonDebtor = new PersonBuilder(AVA).withMoneyOwed(0).build();
assertFalse(nonDebtor.owesMoney());
assertFalse(nonDebtor.isOwingMoney());
}

}

0 comments on commit ec5b6ac

Please sign in to comment.