Files
baseapi/platformapi/yinbaoapi/store_page_test.go
2020-03-25 12:02:28 +08:00

56 lines
1.2 KiB
Go

package yinbaoapi
import (
"testing"
"git.rosy.net.cn/baseapi/utils"
)
func TestCreateCategoryUid(t *testing.T) {
result, err := api.CreateCategoryUid()
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}
func TestLoadSubStoresByUserIdDDLJson(t *testing.T) {
result, err := api.LoadSubStoresByUserIdDDLJson()
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}
func TestAddNewCategory(t *testing.T) {
_, err := api.AddNewCategory(MainStoreVendorOrgCode, "测试2", "测试分类2")
if err != nil {
t.Fatal(err)
}
// t.Log(utils.Format4Output(result, false))
}
func TestUpdateCategory(t *testing.T) {
err := api.UpdateCategory(MainStoreVendorOrgCode, "1585030864115972859", "叶菜3", "蔬菜")
if err != nil {
t.Fatal(err)
}
// t.Log(utils.Format4Output(result, false))
}
func TestDeleteCategory(t *testing.T) {
err := api.DeleteCategory(MainStoreVendorOrgCode, []string{"1585030864115972859"})
if err != nil {
t.Fatal(err)
}
// t.Log(utils.Format4Output(result, false))
}
func TestLoadCategorysWithOption(t *testing.T) {
result, err := api.LoadCategorysWithOption(MainStoreVendorOrgCode)
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}