-
Notifications
You must be signed in to change notification settings - Fork 24
/
bios_test.go
48 lines (43 loc) · 875 Bytes
/
bios_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
/*
* Copyright 2022-present Kuei-chun Chen. All rights reserved.
* bios_test.go
*/
package hatchet
import (
"testing"
)
func TestGenerateBio(t *testing.T) {
bio := generateBio()
// Check that all fields are non-empty
if bio.FirstName == "" {
t.Error("FirstName is empty")
}
if bio.Emails[0] == "" {
t.Error("EmailAddress is empty")
}
if bio.Phones[0] == "" {
t.Error("PhoneNumber is empty")
}
if bio.SSN == "" {
t.Error("SSN is empty")
}
if bio.CreditCards[0] == "" {
t.Error("CreditCardNumber is empty")
}
if bio.State == "" {
t.Error("StateName is empty")
}
if bio.URL == "" {
t.Error("PersonalWebsite is empty")
}
if bio.Intro == "" {
t.Error("ShortDescription is empty")
}
if bio.Age < 1 || bio.Age > 100 {
t.Error("Age is out of range")
}
if bio.Intro == "" {
t.Error("ShortDescription is empty")
}
t.Log(bio.Intro)
}