Skip to content

Commit

Permalink
content(tdd by example): correction in code example
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrtchian committed Jun 23, 2024
1 parent 961a470 commit cae6e51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pages/books/test-driven-development-by-example.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@
class Money implements Expression {
// ...
reduce(to: string) {
const rate = this.currency === "CHF" && to === "USD";
const rate = this.currency === "CHF" && to === "USD" ? 2 : 1;
return new Money(this.amount / rate, to);
}
}
Expand All @@ -1025,7 +1025,7 @@
class Money implements Expression {
// ...
reduce(bank: Bank, to: string) {
const rate = this.currency === "CHF" && to === "USD";
const rate = this.currency === "CHF" && to === "USD" ? 2 : 1;
return new Money(this.amount / rate, to);
}
}
Expand Down

0 comments on commit cae6e51

Please sign in to comment.