- 对于饿百与美团外卖订单,设置其PickDeadline

This commit is contained in:
gazebo
2019-03-28 14:00:08 +08:00
parent 34edcda30c
commit cd99fc3e14
4 changed files with 23 additions and 14 deletions

View File

@@ -4,6 +4,7 @@ import (
"testing"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/globals/refutil"
)
func TestObjFieldByName(t *testing.T) {
@@ -14,27 +15,27 @@ func TestObjFieldByName(t *testing.T) {
ID: 1,
Name: "hello",
}
if GetObjFieldByName(kk, "ID").(int8) != 1 {
if refutil.GetObjFieldByName(kk, "ID").(int8) != 1 {
t.Fatal("value is not ok")
}
if GetObjFieldByName(kk, "Name").(string) != "hello" {
if refutil.GetObjFieldByName(kk, "Name").(string) != "hello" {
t.Fatal("value is not ok")
}
pKK := &kk
if GetObjFieldByName(pKK, "ID").(int8) != 1 {
if refutil.GetObjFieldByName(pKK, "ID").(int8) != 1 {
t.Fatal("value is not ok")
}
if GetObjFieldByName(pKK, "Name").(string) != "hello" {
if refutil.GetObjFieldByName(pKK, "Name").(string) != "hello" {
t.Fatal("value is not ok")
}
SetObjFieldByName(pKK, "ID", int8(100))
SetObjFieldByName(pKK, "Name", "world")
if GetObjFieldByName(pKK, "ID").(int8) != 100 {
refutil.SetObjFieldByName(pKK, "ID", int8(100))
refutil.SetObjFieldByName(pKK, "Name", "world")
if refutil.GetObjFieldByName(pKK, "ID").(int8) != 100 {
t.Fatal("value is not ok")
}
if GetObjFieldByName(pKK, "Name").(string) != "world" {
if refutil.GetObjFieldByName(pKK, "Name").(string) != "world" {
t.Fatal("value is not ok")
}
t.Log(utils.Format4Output(pKK, false))