42 lines
1.0 KiB
Go
42 lines
1.0 KiB
Go
package jdapi
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.rosy.net.cn/baseapi"
|
|
"git.rosy.net.cn/baseapi/utils"
|
|
)
|
|
|
|
func TestGetRealMobileNumber4Order(t *testing.T) {
|
|
orderId := "900658736000042"
|
|
desiredMobile := "18569035610"
|
|
mobile, err := jdapi.GetRealMobile4Order(orderId, "11738115")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if mobile != desiredMobile {
|
|
t.Fatalf("orderId:%s's mobile is wrong, should be %s, but it's:%s", orderId, desiredMobile, mobile)
|
|
}
|
|
baseapi.SugarLogger.Debug(mobile)
|
|
}
|
|
|
|
func TestGetStoreOrderInfo(t *testing.T) {
|
|
orderId := "826309564000021"
|
|
// desiredMobile := "18569035610"
|
|
orderInfo, err := jdapi.GetStoreOrderInfo(orderId, "11738115")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
baseapi.SugarLogger.Debug(utils.Format4Output(orderInfo, false))
|
|
}
|
|
|
|
func TestGetStoreOrderInfoList(t *testing.T) {
|
|
orderInfoList, err := jdapi.GetStoreOrderInfoList("2018-05-01 12:00:00", "2018-05-01 12:59:59")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if true {
|
|
baseapi.SugarLogger.Debug(utils.Format4Output(orderInfoList, false))
|
|
}
|
|
}
|