Skip to content

Commit

Permalink
[#3] Modify test to use $50 and pass in real augend&addends
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanLin-TWer committed Jan 14, 2017
1 parent 5e8131d commit a42819f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public Money times(int multiplier) {


@Override
public Expression plus(Money money) {
return new Sum(Money.dollar(5), Money.dollar(5));
public Expression plus(Money addend) {
return new Sum(this, addend);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import org.junit.jupiter.api.Test;
import support.Tasking;

import java.lang.reflect.Field;

import static org.junit.jupiter.api.Assertions.*;

class MoneyTest {
Expand Down Expand Up @@ -62,12 +60,12 @@ void should_get_10_dollars_when_adding_5_dollars_with_5_dollars() {

@Test
void should_test_our_assumptions_here() {
Money fiveDollars = Money.dollar(5);
Expression result = fiveDollars.plus(fiveDollars);
Money fiftyDollars = Money.dollar(50);
Expression result = fiftyDollars.plus(fiftyDollars);
Sum sum = (Sum) result;

assertEquals(fiveDollars, sum.augend);
assertEquals(fiveDollars, sum.addend);
assertEquals(fiftyDollars, sum.augend);
assertEquals(fiftyDollars, sum.addend);
}
}
}

0 comments on commit a42819f

Please sign in to comment.