-
Notifications
You must be signed in to change notification settings - Fork 2
/
company_test.go
62 lines (55 loc) · 1.34 KB
/
company_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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package nfeio
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestGetCompany(t *testing.T) {
response, err := client.GetCompany("")
assert.NoError(t, err)
assert.Equal(t, "", response.Data.Id)
}
func TestGetCompanies(t *testing.T) {
response, err := client.GetCompanies(1, 10)
assert.NoError(t, err)
assert.NotZero(t, len(response.Data))
}
func TestAddCompany(t *testing.T) {
company := &Company{
Name: "",
FederalTaxNumber: "",
MunicipalTaxNumber: "",
Address: &Address{
Street: "",
Number: "",
AdditionalInformation: "",
PostalCode: "",
City: &City{
Name: "São Paulo",
Code: "3550308",
},
State: "SP",
},
}
response, err := client.AddCompany(company)
assert.NoError(t, err)
assert.Equal(t, "", response.Data.Id)
}
func TestSetCompany(t *testing.T) {
company := &Company{
Id: "",
FederalTaxNumber: "",
Name: "My New Company",
Email: "my@company.com",
}
response, err := client.SetCompany(company)
assert.NoError(t, err)
assert.Equal(t, company.Id, response.Data.Id)
}
func TestDeleteCompany(t *testing.T) {
err := client.DeleteCompany("")
assert.NoError(t, err)
}
//func TestUploadCertificate(t *testing.T) {
// err := client.UploadCertificate("", "", "")
// assert.NoError(t, err)
//}