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.
springframeworkguru#21 - New Currency "Franc" - Basic Test Driven Dev…
…elopment approach, Write test first, make it compile and then flesh it out
- Loading branch information
1 parent
19ad9c6
commit ec361e2
Showing
2 changed files
with
46 additions
and
4 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,24 @@ | ||
package guru.springframework; | ||
|
||
/** | ||
* @author Patrick Corbett | ||
*/ | ||
public class Franc { | ||
|
||
private int amount; | ||
|
||
public Franc(int pAmount) { | ||
amount = pAmount; | ||
} | ||
|
||
Franc times(int pMultiplier) { | ||
return new Franc(amount * pMultiplier); | ||
} | ||
|
||
public boolean equals(Object object) { | ||
// Manual equals, left like this as equals with null or other class will be done later | ||
Franc franc = (Franc) object; | ||
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