chore: 并入 iotlcm-admin-svr 历史到 admin-svr/(原提交 49818c6)

This commit is contained in:
MiFaZhan
2026-11-02 13:27:59 +08:00
1250 changed files with 154111 additions and 0 deletions
@@ -0,0 +1,33 @@
package iot
import (
"testing"
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/consts"
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model"
)
func TestNormalizeOrderItemProduct(t *testing.T) {
tests := []struct {
name string
orderType int
want string
}{
{name: "renew", orderType: consts.OrderTypeCardRenew, want: "卡续费"},
{name: "change", orderType: consts.OrderTypeCardChange, want: "卡变更"},
{name: "subscribe", orderType: consts.OrderTypeCardSubscribe, want: "卡订购"},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
view := &model.TOrderItemViewModel{
ProductName: "余额充值",
ProductSn: "BALANCE_RECHARGE",
}
normalizeOrderItemProduct(test.orderType, view)
if view.ProductName != test.want || view.ProductSn != "" {
t.Fatalf("got name=%q sn=%q, want name=%q and empty sn", view.ProductName, view.ProductSn, test.want)
}
})
}
}