-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcommand_type_test.go
83 lines (80 loc) · 1.65 KB
/
command_type_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
package radarr
import (
"reflect"
"testing"
)
func TestFilter_get(t *testing.T) {
tests := []struct {
name string
f Filter
want *filter
}{
{
name: "FilterByMonitored",
f: FilterByMonitored,
want: &availableFilter[FilterByMonitored],
},
{
name: "FilterByNonMonitored",
f: FilterByNonMonitored,
want: &availableFilter[FilterByNonMonitored],
},
{
name: "FilterAll",
f: FilterAll,
want: &availableFilter[FilterAll],
},
{
name: "FilterByStatusAndAvailable",
f: FilterByStatusAndAvailable,
want: &availableFilter[FilterByStatusAndAvailable],
},
{
name: "FilterByStatusAndReleased",
f: FilterByStatusAndReleased,
want: &availableFilter[FilterByStatusAndReleased],
},
{
name: "FilterByStatusAndInCinemas",
f: FilterByStatusAndInCinemas,
want: &availableFilter[FilterByStatusAndInCinemas],
},
{
name: "FilterByStatusAndAnnounced",
f: FilterByStatusAndAnnounced,
want: &availableFilter[FilterByStatusAndAnnounced],
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := tt.f.get(); !reflect.DeepEqual(got, tt.want) {
t.Errorf("Filter.get() = %v, want %v", got, tt.want)
}
})
}
}
func TestImportMode_get(t *testing.T) {
tests := []struct {
name string
i ImportMode
want string
}{
{
name: "Move",
i: Move,
want: availableImportMode[Move],
},
{
name: "Copy",
i: Copy,
want: availableImportMode[Copy],
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := tt.i.String(); got != tt.want {
t.Errorf("ImportMode.get() = %v, want %v", got, tt.want)
}
})
}
}