forked from dmgk/faker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbusiness_test.go
33 lines (29 loc) · 852 Bytes
/
business_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package faker
import "testing"
func TestBusinessCreditCardNumber(t *testing.T) {
list := valueAt("business.credit_card_numbers").([]string)
for i := 0; i < 5; i++ {
res := Business().CreditCardNumber()
if !includesString(list, res) {
t.Errorf("expected %v to include %v", list, res)
}
}
}
func TestBusinessCreditCardExpiryDate(t *testing.T) {
list := valueAt("business.credit_card_expiry_dates")
for i := 0; i < 5; i++ {
res := Business().CreditCardExpiryDate()
if !includesString(list.([]string), res) {
t.Errorf("expected %v to include %v", list, res)
}
}
}
func TestBusinessCreditCardType(t *testing.T) {
list := valueAt("business.credit_card_types")
for i := 0; i < 5; i++ {
res := Business().CreditCardType()
if !includesString(list.([]string), res) {
t.Errorf("expected %v to include %v", list, res)
}
}
}