-
Notifications
You must be signed in to change notification settings - Fork 2
/
event_test.go
32 lines (26 loc) · 683 Bytes
/
event_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
package cloudwatcher
import "testing"
func TestEvent_TypeString(t *testing.T) {
e := Event{
Type: FileCreated,
}
if e.TypeString() != "FileCreated" {
t.Errorf("FileCreated has been wrongly translated ")
}
e.Type = FileChanged
if e.TypeString() != "FileChanged" {
t.Errorf("FileChanged has been wrongly translated ")
}
e.Type = FileDeleted
if e.TypeString() != "FileDeleted" {
t.Errorf("FileDeleted has been wrongly translated ")
}
e.Type = TagsChanged
if e.TypeString() != "TagsChanged" {
t.Errorf("TagsChanged has been wrongly translated ")
}
e.Type = 999
if e.TypeString() != "unknown" {
t.Errorf("unknown event has been wrongly translated ")
}
}