Files
hfb_sys/backend/internal/modules/adminuser/repository_test.go
T
2026-06-09 19:04:11 +08:00

31 lines
597 B
Go

package adminuser
import "testing"
func TestDepositFreeQuotaAmountCent(t *testing.T) {
tests := []struct {
name string
req DepositFreeQuotaRequest
want int64
}{
{
name: "使用分字段",
req: DepositFreeQuotaRequest{AmountCent: 1234},
want: 1234,
},
{
name: "负分拒绝",
req: DepositFreeQuotaRequest{AmountCent: -1},
want: -1,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := depositFreeQuotaAmountCent(tt.req); got != tt.want {
t.Fatalf("depositFreeQuotaAmountCent() = %d, want %d", got, tt.want)
}
})
}
}