Skip to content

Commit

Permalink
more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
husio committed Mar 25, 2019
1 parent 13ef705 commit 734be10
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions coin/coin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,18 @@ func TestCoinDeserialization(t *testing.T) {
serialized: `{"whole": 1, "fractional": 2, "ticker": "IOV"}`,
wantCoin: NewCoin(1, 2, "IOV"),
},
"old format coin, only whole": {
serialized: `{"whole": 1}`,
wantCoin: NewCoin(1, 0, ""),
},
"old format coin, only fractional": {
serialized: `{"fractional": 1}`,
wantCoin: NewCoin(0, 1, ""),
},
"old format coin, only ticker": {
serialized: `{"ticker": "IOV"}`,
wantCoin: NewCoin(0, 0, "IOV"),
},
"old format empty coin, that maps to fields directly": {
serialized: `{}`,
wantCoin: NewCoin(0, 0, ""),
Expand Down

0 comments on commit 734be10

Please sign in to comment.