chore: 并入 iotlcm-admin-svr 历史到 admin-svr/(原提交 49818c6)
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package iot
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestResolvePackageEffectiveSalePriceUsesSystemDefaults(t *testing.T) {
|
||||
got, err := resolvePackageEffectiveSalePrice(
|
||||
context.Background(),
|
||||
nil,
|
||||
"tenant-1",
|
||||
0,
|
||||
0,
|
||||
packagePriceSource{
|
||||
PackageCode: "PKG-1",
|
||||
CostPrice: 10,
|
||||
TerminalCost: 20,
|
||||
SysDefaultRatio: 80,
|
||||
SysDefaultProfit: 1,
|
||||
SysDefaultTerminalRatio: 50,
|
||||
SysDefaultTerminalProfit: 2,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("resolvePackageEffectiveSalePrice() error = %v", err)
|
||||
}
|
||||
if got.AgentShipmentPrice != 9 {
|
||||
t.Fatalf("agent shipment price = %v, want 9", got.AgentShipmentPrice)
|
||||
}
|
||||
if got.TerminalSalePrice != 12 {
|
||||
t.Fatalf("terminal sale price = %v, want 12", got.TerminalSalePrice)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user