-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake.go
57 lines (51 loc) · 1.59 KB
/
fake.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
package assert
import (
"fmt"
"github.com/lucsky/cuid"
"math/rand"
)
type FakeProfile struct {
FirstName string
LastName string
FullName string
Email string
}
func FakeFirstName() string {
randomNames := []string{
"John", "Jane", "Bob", "Alice", "Charlie", "David", "Eve", "Frank",
"Grace", "Heidi", "Ivan", "Judy", "Kevin", "Laura", "Michael", "Nancy",
"Olivia", "Peter", "Quincy", "Rachel", "Steve", "Tina", "Ursula", "Victor",
"Wendy", "Xander", "Yvonne", "Zach",
}
return randomNames[rand.Intn(len(randomNames))]
}
func FakeLastName() string {
randomLastNames := []string{
"Smith", "Johnson", "Williams", "Brown", "Jones", "Garcia", "Miller",
"Davis", "Rodriguez", "Martinez", "Hernandez", "Lopez", "Gonzalez",
"Wilson", "Anderson", "Thomas", "Taylor", "Moore", "Jackson", "Martin",
"Lee", "Perez", "Thompson", "White", "Harris", "Sanchez", "Clark",
"Ramirez", "Lewis", "Robinson", "Walker", "Young", "Allen", "King",
"Wright", "Scott", "Torres", "Nguyen", "Hill", "Flores", "Green",
"Adams", "Nelson", "Baker", "Hall", "Rivera", "Campbell", "Mitchell",
"Carter", "Roberts",
}
return randomLastNames[rand.Intn(len(randomLastNames))]
}
func GetFakeProfile() *FakeProfile {
firstName := FakeFirstName()
lastName := FakeLastName()
domains := []string{"gmail.com", "yahoo.com", "outlook.com", "aol.com", "protonmail.com"}
return &FakeProfile{
FirstName: firstName,
LastName: lastName,
FullName: fmt.Sprintf("%s %s", firstName, lastName),
Email: fmt.Sprintf(
"%s-%s-%s@%s",
firstName,
lastName,
cuid.New(),
domains[rand.Intn(len(domains))],
),
}
}