-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathcustoms_info_test.go
More file actions
32 lines (24 loc) · 906 Bytes
/
customs_info_test.go
File metadata and controls
32 lines (24 loc) · 906 Bytes
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
package easypost
import (
"reflect"
"strings"
)
func (c *ClientTests) TestCustomsInfoCreate() {
client := c.TestClient()
assert, require := c.Assert(), c.Require()
customsInfo, err := client.CreateCustomsInfo(c.fixture.BasicCustomsInfo())
require.NoError(err)
assert.Equal(reflect.TypeOf(&CustomsInfo{}), reflect.TypeOf(customsInfo))
assert.True(strings.HasPrefix(customsInfo.ID, "cstinfo_"))
assert.Equal("NOEEI 30.37(a)", customsInfo.EELPFC)
}
func (c *ClientTests) TestCustomsInfoRetrieve() {
client := c.TestClient()
assert, require := c.Assert(), c.Require()
customsInfo, err := client.CreateCustomsInfo(c.fixture.BasicCustomsInfo())
require.NoError(err)
retrievedCustomsInfo, err := client.GetCustomsInfo(customsInfo.ID)
require.NoError(err)
assert.Equal(reflect.TypeOf(&CustomsInfo{}), reflect.TypeOf(retrievedCustomsInfo))
assert.Equal(customsInfo, retrievedCustomsInfo)
}