-
Notifications
You must be signed in to change notification settings - Fork 2
/
commerce_test.go
77 lines (65 loc) · 1.74 KB
/
commerce_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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package gw2api
import (
"os"
"testing"
)
func TestCommerceDelivery(t *testing.T) {
key := os.Getenv("APIKEY")
if key == "" {
t.Skip("Unable to test without APIKey")
}
api := New().WithAccessToken(key)
if _, err := api.CommerceDelivery(); err != nil {
t.Errorf("Commerce Delivery failed: '%s'", err)
}
}
func TestCommerceExchangeCoins(t *testing.T) {
api := New()
if _, err := api.CommerceExchangeCoins(1000000); err != nil {
t.Errorf("CommerceExchangeCoins failed: '%s'", err)
}
}
func TestCommerceExchangeGems(t *testing.T) {
api := New()
if _, err := api.CommerceExchangeGems(100); err != nil {
t.Errorf("CommerceExchangeGems failed: '%s'", err)
}
}
func TestCommerceListings(t *testing.T) {
api := New()
if _, err := api.CommerceListings(104); err != nil {
t.Errorf("CommerceListings failed: '%s'", err)
}
}
func TestCommerceListingsIds(t *testing.T) {
api := New()
if _, err := api.CommerceListingsIds(); err != nil {
t.Errorf("CommerceListingsIds failed: '%s'", err)
}
}
func TestCommercePrices(t *testing.T) {
api := New()
if _, err := api.CommercePrices(104); err != nil {
t.Errorf("CommercePrices failed: '%s'", err)
}
}
func TestCommerceTransactionsCurrent(t *testing.T) {
key := os.Getenv("APIKEY")
if key == "" {
t.Skip("Unable to test without APIKey")
}
api := New().WithAccessToken(key)
if _, err := api.CommerceTransactionsCurrent(); err != nil {
t.Errorf("CommerceTransactionsCurrent failed: '%s'", err)
}
}
func TestCommerceTransactionHistory(t *testing.T) {
key := os.Getenv("APIKEY")
if key == "" {
t.Skip("Unable to test without APIKey")
}
api := New().WithAccessToken(key)
if _, err := api.CommerceTransactionsHistory(); err != nil {
t.Errorf("CommerceTransactionsHistory failed: '%s'", err)
}
}