forked from brianvoe/gofakeit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
error_test.go
186 lines (140 loc) · 2.87 KB
/
error_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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
package gofakeit
import (
"fmt"
"testing"
)
func ExampleError() {
Seed(11)
fmt.Println(Error())
// Output: variable assigned before declaration
}
func ExampleFaker_Error() {
f := New(11)
fmt.Println(f.Error())
// Output: variable assigned before declaration
}
func BenchmarkError(b *testing.B) {
for i := 0; i < b.N; i++ {
Error()
}
}
func ExampleErrorObject() {
Seed(11)
fmt.Println(ErrorObject())
// Output: url
}
func ExampleFaker_ErrorObject() {
f := New(11)
fmt.Println(f.ErrorObject())
// Output: url
}
func BenchmarkErrorObject(b *testing.B) {
for i := 0; i < b.N; i++ {
ErrorObject()
}
}
func ExampleErrorDatabase() {
Seed(11)
fmt.Println(ErrorDatabase())
// Output: destination pointer is nil
}
func ExampleFaker_ErrorDatabase() {
f := New(11)
fmt.Println(f.ErrorDatabase())
// Output: destination pointer is nil
}
func BenchmarkErrorDatabase(b *testing.B) {
for i := 0; i < b.N; i++ {
ErrorDatabase()
}
}
func ExampleErrorGRPC() {
Seed(11)
fmt.Println(ErrorGRPC())
// Output: connection refused
}
func ExampleFaker_ErrorGRPC() {
f := New(11)
fmt.Println(f.ErrorGRPC())
// Output: connection refused
}
func BenchmarkErrorGRPC(b *testing.B) {
for i := 0; i < b.N; i++ {
ErrorGRPC()
}
}
func ExampleErrorHTTP() {
Seed(11)
fmt.Println(ErrorHTTP())
// Output: wrote more than the declared Content-Length
}
func ExampleFaker_ErrorHTTP() {
f := New(11)
fmt.Println(f.ErrorHTTP())
// Output: wrote more than the declared Content-Length
}
func BenchmarkErrorHTTP(b *testing.B) {
for i := 0; i < b.N; i++ {
ErrorHTTP()
}
}
func ExampleErrorHTTPClient() {
Seed(11)
fmt.Println(ErrorHTTPClient())
// Output: expectation failed
}
func ExampleFaker_ErrorHTTPClient() {
f := New(11)
fmt.Println(f.ErrorHTTPClient())
// Output: expectation failed
}
func BenchmarkErrorHTTPClient(b *testing.B) {
for i := 0; i < b.N; i++ {
ErrorHTTPClient()
}
}
func ExampleErrorHTTPServer() {
Seed(11)
fmt.Println(ErrorHTTPServer())
// Output: not extended
}
func ExampleFaker_ErrorHTTPServer() {
f := New(11)
fmt.Println(f.ErrorHTTPServer())
// Output: not extended
}
func BenchmarkErrorHTTPServer(b *testing.B) {
for i := 0; i < b.N; i++ {
ErrorHTTPServer()
}
}
func ExampleErrorRuntime() {
Seed(11)
fmt.Println(ErrorRuntime())
// Output: expected 2 arguments, got 3
}
func ExampleFaker_ErrorRuntime() {
f := New(11)
fmt.Println(f.ErrorRuntime())
// Output: expected 2 arguments, got 3
}
func BenchmarkErrorRuntime(b *testing.B) {
for i := 0; i < b.N; i++ {
ErrorRuntime()
}
}
func ExampleErrorValidation() {
Seed(11)
fmt.Println(ErrorValidation())
// Output: payment details cannot be verified
}
func ExampleFaker_ErrorValidation() {
f := New(11)
fmt.Println(f.ErrorValidation())
// Output: payment details cannot be verified
}
func BenchmarkErrorValidation(b *testing.B) {
for i := 0; i < b.N; i++ {
ErrorValidation()
}
}