money.TestCurrency_Create   A
last analyzed

Complexity

Conditions 4

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 9
nop 1
dl 0
loc 12
rs 9.95
c 0
b 0
f 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
	}
27
}
28