forked from lestrrat-go/ical
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entry_test.go
47 lines (38 loc) · 1.06 KB
/
entry_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
package ical_test
/*
import (
"testing"
ical "github.com/lestrrat-go/ical"
"github.com/stretchr/testify/assert"
)
func TestCreateEvent(t *testing.T) {
var entry ical.Entry
e := ical.NewEvent()
entry = e // sanity
_ = entry
if !assert.NotEmpty(t, e.UID(), "ID is not empty") {
return
}
if !assert.NoError(t, e.AddProperty("description", "blah", ical.WithParameters(ical.Parameters{"language": []string{"en"}})), "AddProperty works") {
return
}
if !assert.Equal(t, "BEGIN:VEVENT\r\nDESCRIPTION;LANGUAGE=en:blah\r\nEND:VEVENT\r\n", e.String(), "string matches") {
return
}
}
func TestCreateEventEmptyParameter(t *testing.T) {
var entry ical.Entry
e := ical.NewEvent()
entry = e // sanity
_ = entry
if !assert.NotEmpty(t, e.UID(), "ID is not empty") {
return
}
if !assert.NoError(t, e.AddProperty("description", "blah", ical.WithParameters(ical.Parameters{"language": []string{""}})), "AddProperty works") {
return
}
if !assert.Equal(t, "BEGIN:VEVENT\r\nDESCRIPTION;LANGUAGE=en:blah\r\nEND:VEVENT\r\n", e.String(), "string matches") {
return
}
}
*/