forked from springframeworkguru/tdd-by-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multi Currency Money [springframeworkguru#21. Implement Franc Object …
…by test]
- Loading branch information
Showing
2 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package guru.springframework; | ||
|
||
public class Franc { | ||
private int amount; | ||
public Franc(int amount) { | ||
this.amount = amount; | ||
} | ||
|
||
Franc times(int multiplier) { | ||
return new Franc(this.amount * multiplier); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
Franc franc = (Franc) o; | ||
return amount == franc.amount; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters