| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | package money |
||
| 2 | |||
| 3 | import "testing" |
||
| 4 | |||
| 5 | func TestCurrency_Create(t *testing.T) { |
||
| 6 | tcs := []struct { |
||
| 7 | currency *Currency |
||
| 8 | code string |
||
| 9 | }{ |
||
| 10 | {USD(), "USD"}, |
||
| 11 | {EUR(), "EUR"}, |
||
| 12 | } |
||
| 13 | |||
| 14 | for _, tc := range tcs { |
||
| 15 | if tc.currency.code != tc.code { |
||
| 16 | t.Errorf("Expected %s got %s", tc.code, tc.currency.code) |
||
| 17 | } |
||
| 18 | } |
||
| 19 | } |
||
| 20 | |||
| 21 | func TestCurrency_Add(t *testing.T) { |
||
| 22 | c := Add("BTC", ".", "", 8, "BTC", "1BTC") |
||
| 23 | |||
| 24 | if c.code != "BTC" { |
||
| 25 | t.Errorf("Expected %s got %s", "BTC", c.code) |
||
| 26 | } |
||
| 28 |