-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathblood_test.go
41 lines (36 loc) · 1021 Bytes
/
blood_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
34
35
36
37
38
39
40
41
package faker
import (
"reflect"
"strings"
"testing"
"github.com/go-faker/faker/v4/pkg/slice"
)
func TestBloodType(t *testing.T) {
bloodType, err := GetBlood().BloodType(reflect.Value{})
if err != nil {
t.Error("Expected not error, got err", err)
}
if !slice.Contains(bloodTypes, bloodType.(string)) {
t.Error("Expected value from variable bloodType in function BloodType")
}
}
func TestBloodRhFactor(t *testing.T) {
bloodRhFactor, err := GetBlood().BloodRHFactor(reflect.Value{})
if err != nil {
t.Error("Expected not error, got err", err)
}
if !slice.Contains(bloodRhFactors, bloodRhFactor.(string)) {
t.Error("Expected value from variable bloodRhFactor in function BloodType")
}
}
func TestBloodGroup(t *testing.T) {
bloodTypes = []string{"O"}
bloodRhFactors = []string{"+"}
bloodGroup, err := GetBlood().BloodGroup(reflect.Value{})
if err != nil {
t.Error("Expected not error, got err", err)
}
if !strings.Contains(bloodGroup.(string), "O+") {
t.Error("Expected get url")
}
}