forked from jaswdr/faker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
person_test.go
63 lines (53 loc) · 1.38 KB
/
person_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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package faker
import (
"strings"
"testing"
)
func TestTitleMale(t *testing.T) {
p := New().Person()
Expect(t, "Mr.", p.TitleMale())
}
func TestTitleFemale(t *testing.T) {
p := New().Person()
Expect(t, "Ms.", p.TitleFemale())
}
func TestTitle(t *testing.T) {
p := New().Person()
Expect(t, 3, len(p.Title()))
}
func TestSuffix(t *testing.T) {
p := New().Person()
suffix := p.Suffix()
Expect(t, true, len(suffix) > 0)
}
func TestFirstNameMale(t *testing.T) {
p := New().Person()
firstName := p.FirstNameMale()
Expect(t, true, len(firstName) > 0)
}
func TestFirstNameFemale(t *testing.T) {
p := New().Person()
firstName := p.FirstNameFemale()
Expect(t, true, len(firstName) > 0)
}
func TestFirstName(t *testing.T) {
p := New().Person()
firstName := p.FirstName()
Expect(t, true, len(firstName) > 0)
}
func TestLastName(t *testing.T) {
p := New().Person()
lastName := p.LastName()
Expect(t, true, len(lastName) > 0)
}
func TestName(t *testing.T) {
p := New().Person()
name := p.Name()
Expect(t, true, len(name) > 0)
Expect(t, false, strings.Contains(name, "{{titleMale}}"))
Expect(t, false, strings.Contains(name, "{{firstNameMale}}"))
Expect(t, false, strings.Contains(name, "{{titleFemale}}"))
Expect(t, false, strings.Contains(name, "{{firstNameFemale}}"))
Expect(t, false, strings.Contains(name, "{{lastName}}"))
Expect(t, false, strings.Contains(name, "{{suffix}}"))
}