-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathgender_test.go
More file actions
42 lines (36 loc) · 788 Bytes
/
gender_test.go
File metadata and controls
42 lines (36 loc) · 788 Bytes
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
42
package faker_test
import (
"fmt"
"testing"
"github.com/pioz/faker"
"github.com/stretchr/testify/assert"
)
func ExampleGender() {
faker.SetSeed(1500)
fmt.Println(faker.Gender())
// Output: Cisgender Male
}
func ExampleBinaryGender() {
faker.SetSeed(1501)
fmt.Println(faker.BinaryGender())
// Output: Male
}
func ExampleShortBinaryGender() {
faker.SetSeed(1502)
fmt.Println(faker.ShortBinaryGender())
// Output: m
}
func TestGenderBuild(t *testing.T) {
faker.SetSeed(1520)
s := &struct {
Field1 string `faker:"Gender"`
Field2 string `faker:"BinaryGender"`
Field3 string `faker:"ShortBinaryGender"`
}{}
err := faker.Build(&s)
assert.Nil(t, err)
t.Log(s)
assert.Equal(t, "Cis", s.Field1)
assert.Equal(t, "Female", s.Field2)
assert.Equal(t, "m", s.Field3)
}