Skip to content

Commit

Permalink
✨ 【第3章 三角測量】null との等値性比較のテストを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
dodonki1223 committed Dec 7, 2021
1 parent e9da677 commit c5788d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
- [ ] amount を private にする
- [x] Dollar の副作用どうする?
- [ ] Money の丸め処理どうする?
- [ ] nullとの等価性比較
- [x] equals()メソッドの実装
7 changes: 7 additions & 0 deletions src/__tests__/dollar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ test('equals', () => {
expect(new Dollar(5).equals(new Dollar(5))).toBeTruthy();
expect(new Dollar(5).equals(new Dollar(6))).toBeFalsy();
});

test('null equals', () => {
const five = new Dollar(5);
const ten = five.times(2);

expect(ten.equals(null)).toBeFalsy();
});

0 comments on commit c5788d5

Please sign in to comment.