fix(review): harden payment, oauth, and migration paths
This commit is contained in:
@@ -5,6 +5,7 @@ package service
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"math"
|
||||
"testing"
|
||||
|
||||
dbent "github.com/Wei-Shaw/sub2api/ent"
|
||||
@@ -322,6 +323,16 @@ func TestParseLegacyPaymentOrderID(t *testing.T) {
|
||||
assert.False(t, ok)
|
||||
}
|
||||
|
||||
func TestIsValidProviderAmount(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
assert.True(t, isValidProviderAmount(0.01))
|
||||
assert.False(t, isValidProviderAmount(0))
|
||||
assert.False(t, isValidProviderAmount(-1))
|
||||
assert.False(t, isValidProviderAmount(math.NaN()))
|
||||
assert.False(t, isValidProviderAmount(math.Inf(1)))
|
||||
}
|
||||
|
||||
func TestValidateProviderNotificationMetadataRejectsAlipaySnapshotMismatch(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user