-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathusers_default_test.go
More file actions
54 lines (47 loc) · 967 Bytes
/
users_default_test.go
File metadata and controls
54 lines (47 loc) · 967 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
45
46
47
48
49
50
51
52
53
54
// Code generated by go generate; DO NOT EDIT.
package brightbox
import (
"path"
"testing"
"time"
"gotest.tools/v3/assert"
)
func TestUsers(t *testing.T) {
instance := testAll(
t,
(*Client).Users,
"User",
"users",
"Users",
)
assert.Equal(t, instance.ID, "usr-kl435")
}
func TestUser(t *testing.T) {
instance := testInstance(
t,
(*Client).User,
"User",
path.Join("users", "usr-kl435"),
"user",
"usr-kl435",
)
assert.Equal(t, instance.ID, "usr-kl435")
}
func TestUpdateUser(t *testing.T) {
updatedResource := UserOptions{ID: "usr-kl435"}
instance := testModify(
t,
(*Client).UpdateUser,
updatedResource,
"user",
"PUT",
path.Join("users", updatedResource.ID),
"{}",
)
assert.Equal(t, instance.ID, updatedResource.ID)
}
func TestUserCreatedAtUnix(t *testing.T) {
tm := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
target := User{CreatedAt: &tm}
assert.Equal(t, target.CreatedAtUnix(), tm.Unix())
}