优化订单支付
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package dispute
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"hfb_sys/backend/internal/model"
|
||||
@@ -76,3 +77,25 @@ func TestBuildArbitrationSettlementLimitsFrozenReleaseToExistingBalance(t *testi
|
||||
t.Fatalf("release frozen entry count = %d, want 1", releaseEntryCount)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildArbitrationHandoffContent(t *testing.T) {
|
||||
content := buildArbitrationHandoffContent(ArbitrateRequest{
|
||||
Result: "partial_refund",
|
||||
Remark: "账号异常,退还部分租金。",
|
||||
}, arbitrationSettlement{
|
||||
RenterRefundAmount: 80,
|
||||
OwnerIncomeAmount: 120,
|
||||
})
|
||||
|
||||
wantParts := []string{
|
||||
"客服仲裁结果:部分退款",
|
||||
"处理说明:账号异常,退还部分租金。",
|
||||
"退款给租客:¥80.00",
|
||||
"结算给号主:¥120.00",
|
||||
}
|
||||
for _, part := range wantParts {
|
||||
if !strings.Contains(content, part) {
|
||||
t.Fatalf("handoff content = %q, want include %q", content, part)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user