Files
jx-callback/business/partner/purchase/jdshop/order_test.go
邹宗楠 1941dedcf4 123
2021-12-02 18:53:26 +08:00

50 lines
1.4 KiB
Go

package jdshop
import (
"git.rosy.net.cn/baseapi/platformapi/jdshopapi"
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
"git.rosy.net.cn/jx-callback/business/partner"
"git.rosy.net.cn/jx-callback/business/partner/putils"
"reflect"
"testing"
)
func TestPurchaseHandler_GetJdsOrders(t *testing.T) {
type fields struct {
BasePurchasePlatform partner.BasePurchasePlatform
DefSingleStorePlatform putils.DefSingleStorePlatform
}
type args struct {
ctx *jxcontext.Context
orderCreatedStart string
orderCreatedEnd string
current int
pageSize int
}
tests := []struct {
name string
fields fields
args args
wantOrderResult *jdshopapi.AllOrdersResult
wantErr bool
}{
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
p := &PurchaseHandler{
BasePurchasePlatform: tt.fields.BasePurchasePlatform,
DefSingleStorePlatform: tt.fields.DefSingleStorePlatform,
}
gotOrderResult, err := p.GetJdsOrders(tt.args.ctx, tt.args.orderCreatedStart, tt.args.orderCreatedEnd, tt.args.current, tt.args.pageSize)
if (err != nil) != tt.wantErr {
t.Errorf("GetJdsOrders() error = %v, wantErr %v", err, tt.wantErr)
return
}
if !reflect.DeepEqual(gotOrderResult, tt.wantOrderResult) {
t.Errorf("GetJdsOrders() gotOrderResult = %v, want %v", gotOrderResult, tt.wantOrderResult)
}
})
}
}