Skip to content

Commit 05a2b77

Browse files
committed
✨ (bitcoin-wallet): add test for basic requirement
1 parent b14e4f4 commit 05a2b77

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package pointers_and_errors
2+
3+
// type Wallet struct {
4+
// }
5+
6+
// func (w Wallet) Deposit(amount int) {}
7+
8+
// func (w Wallet) Balance() int {
9+
// return 0
10+
// }
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package pointers_and_errors
2+
3+
import "testing"
4+
5+
// Bitcoin Wallet
6+
func TestWallet(t *testing.T) {
7+
wallet := Wallet{}
8+
9+
wallet.Deposit(10)
10+
got := wallet.Balance()
11+
want := 10
12+
if got != want {
13+
t.Errorf("got %d, want %d", got, want)
14+
}
15+
}

0 commit comments

Comments
 (0)