-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnotify_test.go
38 lines (34 loc) · 925 Bytes
/
notify_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
package notify
import "testing"
var notifyTests = []struct {
desc string
got Notification
want Notification
}{
{
`NewNotification("foo", "bar")`,
NewNotification("foo", "bar"),
Notification{Title: "foo", Text: "bar"},
},
{
`NewSubtitledNotification("foo", "bar", "baz")`,
NewSubtitledNotification("foo", "bar", "baz"),
Notification{Title: "foo", Subtitle: "bar", Text: "baz"},
},
{
`NewNotificationWithSound("foo", "bar", "baz")`,
NewNotificationWithSound("foo", "bar", "baz"),
Notification{Title: "foo", Text: "bar", Sound: "baz"},
},
{
`NewSubtitledNotificationWithSound("foo", "bar", "baz", "qux")`,
NewSubtitledNotificationWithSound("foo", "bar", "baz", "qux"),
Notification{Title: "foo", Subtitle: "bar", Text: "baz", Sound: "qux"},
},
}
func TestNewNotificationHelpers(t *testing.T) {
t.Parallel()
for _, perm := range notifyTests {
assertEquals(t, perm.got, perm.want)
}
}