-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshipping_services_test.go
42 lines (34 loc) · 1.04 KB
/
shipping_services_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
package goafterbuy_test
import (
"github.com/jjideenschmiede/goafterbuy"
"testing"
)
// TestShippingServices is to test the shipping services function
func TestShippingServices(t *testing.T) {
// Define variables for request
partnerToken := ""
accountToken := ""
// Define products body
body := goafterbuy.ShippingServicesBody{
Request: goafterbuy.ShippingServicesRequest{
AfterbuyGlobal: goafterbuy.AfterbuyGlobal{
PartnerToken: partnerToken,
AccountToken: accountToken,
CallName: "GetShippingServices",
ErrorLanguage: "DE",
},
},
}
// Get shipping services
shippingServices, err := goafterbuy.ShippingServices(body)
if err != nil {
t.Fatal(err)
}
// Check the results
var results []string
for _, value := range shippingServices.Result.ShippingServices.ShippingService {
results = append(results, value.Name)
}
// Print output
t.Logf("The shipping services were read. There are \"%d\" shipping services. Here you can see the names of the shipping services read out: %v.", len(results), results)
}