aboutsummaryrefslogtreecommitdiffstats
path: root/cost_test.go
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2026-05-21 14:40:50 -0400
committerSam Anthony <sam@samanthony.xyz>2026-05-21 14:40:50 -0400
commit4370a8133c8e9c870d7d2c659f27ac655896eec0 (patch)
treea36bfb14030c6a01a9753aa0162c06d5c175fcfd /cost_test.go
parent473bfaddb6acd44e208406a224d75b75fdf9ec97 (diff)
downloadlulu-4370a8133c8e9c870d7d2c659f27ac655896eec0.zip
shorten client method names; implement order cancelation
Diffstat (limited to 'cost_test.go')
-rw-r--r--cost_test.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/cost_test.go b/cost_test.go
index 446440d..c2f18ec 100644
--- a/cost_test.go
+++ b/cost_test.go
@@ -10,14 +10,14 @@ import (
)
var (
- //go:embed testdata/printjobcostreq.json
- printJobCostReqJson string
+ //go:embed testdata/costreq.json
+ costReqJson string
- //go:embed testdata/printjobcostresp.json
- printJobCostRespJson string
+ //go:embed testdata/costresp.json
+ costRespJson string
)
-var printJobCostReqSample = printJobCostReq{
+var costReqSample = printJobCostReq{
[]PrintJobCostLineItem{
{
32,
@@ -129,16 +129,16 @@ var printJobCostRespSample = printJobCostResp{
}
func TestMarshalPrintJobCostReq(t *testing.T) {
- requireMarshalJsonEq(t, printJobCostReqJson, printJobCostReqSample)
+ requireMarshalJsonEq(t, costReqJson, costReqSample)
}
func TestUnmarshalPrintJobCostResp(t *testing.T) {
- requireUnmarshalJsonEq(t, printJobCostRespSample, printJobCostRespJson)
+ requireUnmarshalJsonEq(t, printJobCostRespSample, costRespJson)
}
-func TestPrintJobCost(t *testing.T) {
+func TestCost(t *testing.T) {
c := newClient(t)
- items := printJobCostReqSample.LineItems
+ items := costReqSample.LineItems
addr := ShippingAddress{
City: "Lübeck",
Country: "DE",
@@ -147,8 +147,8 @@ func TestPrintJobCost(t *testing.T) {
Street1: "Holstenstr. 40",
Phone: MustParsePhoneNumber("844-212-0689"),
}
- shiplvl := printJobCostReqSample.ShipOpt
- cost, av, err := c.PrintJobCost(items, addr, shiplvl)
+ shiplvl := costReqSample.ShipOpt
+ cost, av, err := c.Cost(items, addr, shiplvl)
require.NoError(t, err)
require.Equal(t, printJobCostRespSample.AddressValidation, av)
requireCurrency(t, cost.Currency)