-
Notifications
You must be signed in to change notification settings - Fork 0
/
default_test.go
44 lines (39 loc) · 1021 Bytes
/
default_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package vies_test
import (
"testing"
"github.com/macabu/vies"
)
func TestDefaultCheckVAT(t *testing.T) {
vat, err := vies.CheckVAT("NL810060255B01")
if err != nil {
t.Errorf("expected err to be nil, got %v", err.Error())
}
if vat == nil {
t.Error("expected vat to not be nil, got nil")
}
if vat != nil && !vat.Valid {
t.Error("expected vat to be true, got false")
}
}
func TestDefaultCheckVATWithCountry(t *testing.T) {
vat, err := vies.CheckVATWithCountry("NL", "NL810060255B01")
if err != nil {
t.Errorf("expected err to be nil, got %v", err.Error())
}
if vat == nil {
t.Error("expected vat to not be nil, got nil")
}
if vat != nil && !vat.Valid {
t.Error("expected vat to be true, got false")
}
vat, err = vies.CheckVATWithCountry("NL", "810060255B01")
if err != nil {
t.Errorf("expected err to be nil, got %v", err.Error())
}
if vat == nil {
t.Error("expected vat to not be nil, got nil")
}
if vat != nil && !vat.Valid {
t.Error("expected vat to be true, got false")
}
}