quotation service fixed
This commit is contained in:
28
api/payments/storage/model/rails_test.go
Normal file
28
api/payments/storage/model/rails_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package model
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestParseRail(t *testing.T) {
|
||||
cases := []struct {
|
||||
name string
|
||||
input string
|
||||
want Rail
|
||||
}{
|
||||
{name: "crypto", input: "crypto", want: RailCrypto},
|
||||
{name: "settlement canonical", input: "SETTLEMENT", want: RailProviderSettlement},
|
||||
{name: "settlement legacy", input: "provider_settlement", want: RailProviderSettlement},
|
||||
{name: "card canonical", input: "card", want: RailCardPayout},
|
||||
{name: "card legacy", input: "card_payout", want: RailCardPayout},
|
||||
{name: "onramp", input: "fiat_onramp", want: RailFiatOnRamp},
|
||||
{name: "offramp", input: "fiat_offramp", want: RailFiatOffRamp},
|
||||
{name: "unknown", input: "telegram", want: RailUnspecified},
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
if got := ParseRail(tc.input); got != tc.want {
|
||||
t.Fatalf("ParseRail(%q) = %q, want %q", tc.input, got, tc.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user