This repository has been archived by the owner on May 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
products_test.go
185 lines (172 loc) · 6.3 KB
/
products_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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
package mws
import (
"testing"
)
func TestProductService_ListMatchingProducts(t *testing.T) {
requestID, result, err := NewProductService().ListMatchingProducts(TestCredential, TestCredential.Region.MarketPlaceID, "B084WZNV33")
if err != nil {
t.Errorf("ListMatchingProducts() error = %v", err)
return
}
if requestID == "" {
t.Errorf("ListMatchingProducts() requestID = %v", requestID)
}
if result == nil {
t.Errorf("ListMatchingProducts() result = %v", result)
}
t.Logf("result = %v", JsonMarshalIndentToString(result))
}
func TestProductService_GetMatchingProduct(t *testing.T) {
requestID, result, err := NewProductService().GetMatchingProduct(TestCredential, TestCredential.Region.MarketPlaceID, "B084WZNV33", "B0EXAMPLEG")
if err != nil {
t.Errorf("GetMatchingProduct() error = %v", err)
return
}
if requestID == "" {
t.Errorf("GetMatchingProduct() requestID = %v", requestID)
}
if result == nil {
t.Errorf("GetMatchingProduct() result = %v", result)
}
t.Logf("result = %v", JsonMarshalIndentToString(result))
}
func TestProductService_GetMatchingProductForId(t *testing.T) {
requestID, result, err := NewProductService().GetMatchingProductForId(TestCredential, TestCredential.Region.MarketPlaceID, "EAN", "6003551978396", "4003994155486")
if err != nil {
t.Errorf("GetMatchingProductForId() error = %v", err)
return
}
if requestID == "" {
t.Errorf("GetMatchingProductForId() requestID = %v", requestID)
}
if result == nil {
t.Errorf("GetMatchingProductForId() result = %v", result)
}
t.Logf("result = %v", JsonMarshalIndentToString(result))
}
func TestProductService_GetCompetitivePricingForSKU(t *testing.T) {
requestID, result, err := NewProductService().GetCompetitivePricingForSKU(TestCredential, TestCredential.Region.MarketPlaceID, "MG-356J-1QOR", "56789")
if err != nil {
t.Errorf("GetCompetitivePricingForSKU() error = %v", err)
return
}
if requestID == "" {
t.Errorf("GetCompetitivePricingForSKU() requestID = %v", requestID)
}
if result == nil {
t.Errorf("GetCompetitivePricingForSKU() result = %v", result)
}
t.Logf("result = %v", JsonMarshalIndentToString(result))
}
func TestProductService_GetCompetitivePricingForASIN(t *testing.T) {
requestID, result, err := NewProductService().GetCompetitivePricingForASIN(TestCredential, TestCredential.Region.MarketPlaceID, "B084WZNV33", "B0EXAMPLEG")
if err != nil {
t.Errorf("GetCompetitivePricingForASIN() error = %v", err)
return
}
if requestID == "" {
t.Errorf("GetCompetitivePricingForASIN() requestID = %v", requestID)
}
if result == nil {
t.Errorf("GetCompetitivePricingForASIN() result = %v", result)
}
t.Logf("result = %v", JsonMarshalIndentToString(result))
}
func TestProductService_GetMyPriceForSKU(t *testing.T) {
requestID, result, err := NewProductService().GetMyPriceForSKU(TestCredential, TestCredential.Region.MarketPlaceID, "MG-356J-1QOR", "56789")
if err != nil {
t.Errorf("GetMyPriceForSKU() error = %v", err)
return
}
if requestID == "" {
t.Errorf("GetMyPriceForSKU() requestID = %v", requestID)
}
if result == nil {
t.Errorf("GetMyPriceForSKU() result = %v", result)
}
t.Logf("result = %v", JsonMarshalIndentToString(result))
}
func TestProductService_GetMyPriceForASIN(t *testing.T) {
requestID, result, err := NewProductService().GetMyPriceForASIN(TestCredential, TestCredential.Region.MarketPlaceID, "B084WZNV33", "B0EXAMPLEG")
if err != nil {
t.Errorf("GetMyPriceForASIN() error = %v", err)
return
}
if requestID == "" {
t.Errorf("GetMyPriceForASIN() requestID = %v", requestID)
}
if result == nil {
t.Errorf("GetMyPriceForASIN() result = %v", result)
}
t.Logf("result = %v", JsonMarshalIndentToString(result))
}
func TestProductService_GetProductCategoriesForSKU(t *testing.T) {
requestID, result, err := NewProductService().GetProductCategoriesForSKU(TestCredential, TestCredential.Region.MarketPlaceID, "MG-356J-1QOR")
if err != nil {
t.Errorf("GetProductCategoriesForSKU() error = %v", err)
return
}
if requestID == "" {
t.Errorf("GetProductCategoriesForSKU() requestID = %v", requestID)
}
if result == nil {
t.Errorf("GetProductCategoriesForSKU() result = %v", result)
}
t.Logf("result = %v", JsonMarshalIndentToString(result))
}
func TestProductService_GetProductCategoriesForASIN(t *testing.T) {
requestID, result, err := NewProductService().GetProductCategoriesForASIN(TestCredential, TestCredential.Region.MarketPlaceID, "B084WZNV33")
if err != nil {
t.Errorf("GetProductCategoriesForASIN() error = %v", err)
return
}
if requestID == "" {
t.Errorf("GetProductCategoriesForASIN() requestID = %v", requestID)
}
if result == nil {
t.Errorf("GetProductCategoriesForASIN() result = %v", result)
}
t.Logf("result = %v", JsonMarshalIndentToString(result))
}
func TestProductService_GetLowestOfferListingsForSKU(t *testing.T) {
requestID, result, err := NewProductService().GetLowestOfferListingsForSKU(TestCredential, TestCredential.Region.MarketPlaceID, "MG-356J-1QOR")
if err != nil {
t.Errorf("GetLowestOfferListingsForSKU() error = %v", err)
return
}
if requestID == "" {
t.Errorf("GetLowestOfferListingsForSKU() requestID = %v", requestID)
}
if result == nil {
t.Errorf("GetLowestOfferListingsForSKU() result = %v", result)
}
t.Logf("result = %v", JsonMarshalIndentToString(result))
}
func TestProductService_GetLowestOfferListingsForASIN(t *testing.T) {
requestID, result, err := NewProductService().GetLowestOfferListingsForASIN(TestCredential, TestCredential.Region.MarketPlaceID, "B084WZNV33")
if err != nil {
t.Errorf("GetLowestOfferListingsForASIN() error = %v", err)
return
}
if requestID == "" {
t.Errorf("GetLowestOfferListingsForASIN() requestID = %v", requestID)
}
if result == nil {
t.Errorf("GetLowestOfferListingsForASIN() result = %v", result)
}
t.Logf("result = %v", JsonMarshalIndentToString(result))
}
func TestProductService_GetLowestPricedOffersForSKU(t *testing.T) {
requestID, result, err := NewProductService().GetLowestPricedOffersForSKU(TestCredential, TestCredential.Region.MarketPlaceID, "MG-356J-1QOR", "New")
if err != nil {
t.Errorf("GetLowestPricedOffersForSKU() error = %v", err)
return
}
if requestID == "" {
t.Errorf("GetLowestPricedOffersForSKU() requestID = %v", requestID)
}
if result == nil {
t.Errorf("GetLowestPricedOffersForSKU() result = %v", result)
}
t.Logf("result = %v", JsonMarshalIndentToString(result))
}