统一金额分制重构
This commit is contained in:
@@ -9,18 +9,13 @@ func TestDepositFreeQuotaAmountCent(t *testing.T) {
|
||||
want int64
|
||||
}{
|
||||
{
|
||||
name: "优先使用分字段",
|
||||
req: DepositFreeQuotaRequest{AmountCent: 1234, Amount: 99},
|
||||
want: 1234,
|
||||
},
|
||||
{
|
||||
name: "缺少分字段时回退元字段",
|
||||
req: DepositFreeQuotaRequest{Amount: 12.34},
|
||||
name: "使用分字段",
|
||||
req: DepositFreeQuotaRequest{AmountCent: 1234},
|
||||
want: 1234,
|
||||
},
|
||||
{
|
||||
name: "负分拒绝",
|
||||
req: DepositFreeQuotaRequest{AmountCent: -1, Amount: 12.34},
|
||||
req: DepositFreeQuotaRequest{AmountCent: -1},
|
||||
want: -1,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user