forked from neotoolkit/faker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinternet_test.go
More file actions
44 lines (38 loc) · 893 Bytes
/
internet_test.go
File metadata and controls
44 lines (38 loc) · 893 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
43
44
package faker_test
import (
"testing"
"github.com/neotoolkit/faker"
)
func TestFaker_HTTPMethod(t *testing.T) {
t.Parallel()
f := faker.New(faker.WithHTTPMethods("test"))
httpMethod := f.HTTPMethod()
if len(httpMethod) == 0 {
t.Error("HTTP method is empty")
}
if httpMethod != "test" {
t.Errorf("got %s, want test", httpMethod)
}
}
func TestHTTPMethod(t *testing.T) {
t.Parallel()
httpMethod := faker.HTTPMethod()
if len(httpMethod) == 0 {
t.Error("HTTP method is empty")
}
}
func TestFaker_HTTPStatusCode(t *testing.T) {
t.Parallel()
f := faker.New(faker.WithHTTPStatusCodes(200))
httpStatusCode := f.HTTPStatusCode()
if httpStatusCode != 200 {
t.Errorf("got %v, want 200", httpStatusCode)
}
}
func TestHTTPStatusCode(t *testing.T) {
t.Parallel()
httpStatusCode := faker.HTTPStatusCode()
if httpStatusCode == 0 {
t.Error("HTTP status code is empty")
}
}