-
Notifications
You must be signed in to change notification settings - Fork 5
/
enumerations_test.go
64 lines (45 loc) · 1.45 KB
/
enumerations_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
package redmine
import (
"testing"
)
func TestEnumerationCRUD(t *testing.T) {
var r Context
// Init Redmine context
initTest(&r, t)
// Get enumeration priorities
testEnumerationPrioritiesAllGet(t, r)
// Get enumeration time entry activities
testEnumerationTimeEntryActivitiesAllGet(t, r)
// Get enumeration document categories
testEnumerationDocumentCategoriesAllGet(t, r)
}
func testEnumerationPrioritiesAllGet(t *testing.T, r Context) {
e, _, err := r.EnumerationPrioritiesAllGet()
if err != nil {
t.Fatal("Enumeration priorities get error:", err)
}
if len(e) == 0 {
t.Fatal("Enumeration priorities get error: can't find any priorities")
}
t.Logf("Enumeration priorities: success")
}
func testEnumerationTimeEntryActivitiesAllGet(t *testing.T, r Context) {
e, _, err := r.EnumerationTimeEntryActivitiesAllGet()
if err != nil {
t.Fatal("Enumeration time entry activities get error:", err)
}
if len(e) == 0 {
t.Fatal("Enumeration time entry activities get error: can't find any time entry activities")
}
t.Logf("Enumeration time entry activities: success")
}
func testEnumerationDocumentCategoriesAllGet(t *testing.T, r Context) {
e, _, err := r.EnumerationDocumentCategoriesAllGet()
if err != nil {
t.Fatal("Enumeration document categories get error:", err)
}
if len(e) == 0 {
t.Fatal("Enumeration document categories get error: can't find any document categories")
}
t.Logf("Enumeration document categories: success")
}