Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/main/java/guru/springframework/Sum.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
* Created by jt on 10/10/18.
*/
public class Sum implements Expression {
Money augmend;
Money addmend;
Money augend;
Money addend;

public Sum(Money augmend, Money addmend) {
this.augmend = augmend;
this.addmend = addmend;
public Sum(Money augend, Money addend) {
this.augend = augend;
this.addend = addend;
}

public Money reduce(String to) {
int amount = augmend.amount + addmend.amount;
int amount = augend.amount + addend.amount;
return new Money(amount, to);
}
}
4 changes: 2 additions & 2 deletions src/test/java/guru/springframework/MoneyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ void testPlusReturnsSum() {
Money five = Money.dollar(5);
Expression result = five.plus(five);
Sum sum = (Sum) result;
assertEquals(five, sum.augmend);
assertEquals(five, sum.addmend);
assertEquals(five, sum.augend);
assertEquals(five, sum.addend);
}

@Test
Expand Down