-
Notifications
You must be signed in to change notification settings - Fork 2
/
collaborations_default_test.go
67 lines (59 loc) · 1.31 KB
/
collaborations_default_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
// Code generated by go generate; DO NOT EDIT.
package brightbox
import (
"path"
"testing"
"time"
"gotest.tools/v3/assert"
)
func TestCollaborations(t *testing.T) {
instance := testAll(
t,
(*Client).Collaborations,
"Collaboration",
"collaborations",
"Collaborations",
)
assert.Equal(t, instance.ID, "col-klek3")
}
func TestCollaboration(t *testing.T) {
instance := testInstance(
t,
(*Client).Collaboration,
"Collaboration",
path.Join("collaborations", "col-klek3"),
"collaboration",
"col-klek3",
)
assert.Equal(t, instance.ID, "col-klek3")
}
func TestCreateCollaboration(t *testing.T) {
newResource := CollaborationOptions{}
instance := testModify(
t,
(*Client).CreateCollaboration,
newResource,
"collaboration",
"POST",
path.Join("collaborations"),
"{}",
)
assert.Equal(t, instance.ID, "col-klek3")
}
func TestDestroyCollaboration(t *testing.T) {
deletedResource := testModify(
t,
(*Client).DestroyCollaboration,
"col-klek3",
"collaboration",
"DELETE",
path.Join("collaborations", "col-klek3"),
"",
)
assert.Equal(t, deletedResource.ID, "col-klek3")
}
func TestCollaborationCreatedAtUnix(t *testing.T) {
tm := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
target := Collaboration{CreatedAt: &tm}
assert.Equal(t, target.CreatedAtUnix(), tm.Unix())
}