优化后台商品审核价格调整
This commit is contained in:
@@ -14,8 +14,22 @@ func TestConsumableValueOnlyCountsChargedResources(t *testing.T) {
|
||||
},
|
||||
})
|
||||
|
||||
if value != 2 {
|
||||
t.Fatalf("expected 2, got %.2f", value)
|
||||
if value != 1.5 {
|
||||
t.Fatalf("expected 1.5, got %.2f", value)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCalculateAdminAdjustedPriceByRatio(t *testing.T) {
|
||||
base, total, ratio := calculateAdminAdjustedPrice(AdminPriceAdjustRequest{BuyerRatio: 25}, 1000, 20)
|
||||
if base != 40 || total != 60 || ratio != 25 {
|
||||
t.Fatalf("unexpected adjusted price: base=%.2f total=%.2f ratio=%.2f", base, total, ratio)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCalculateAdminAdjustedPriceByTotalPrice(t *testing.T) {
|
||||
base, total, ratio := calculateAdminAdjustedPrice(AdminPriceAdjustRequest{BuyerTotalPrice: 70}, 1000, 20)
|
||||
if base != 50 || total != 70 || ratio != 20 {
|
||||
t.Fatalf("unexpected adjusted price: base=%.2f total=%.2f ratio=%.2f", base, total, ratio)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user