-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_test.go
49 lines (44 loc) · 904 Bytes
/
model_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
package kong
import (
"testing"
"time"
"github.com/andygrunwald/go-jira"
"github.com/google/go-cmp/cmp"
)
func TestNewSprint(t *testing.T) {
t.Run("without-end-date", func(t *testing.T) {
sprint := jira.Sprint{
ID: 1,
Name: "Komodo",
State: "active",
}
got := NewSprint(sprint)
want := Sprint{
ID: 1,
Name: "Komodo",
State: "active",
}
if diff := cmp.Diff(got, want); diff != "" {
t.Errorf("diff: %s", diff)
}
})
t.Run("with-end-date", func(t *testing.T) {
sprint := jira.Sprint{
ID: 1,
Name: "Komodo",
State: "active",
}
endDate := time.Date(1933, time.April, 7, 0, 0, 0, 0, time.UTC)
sprint.EndDate = &endDate
got := NewSprint(sprint)
want := Sprint{
ID: 1,
Name: "Komodo",
State: "active",
EndDate: endDate,
}
if diff := cmp.Diff(got, want); diff != "" {
t.Errorf("diff: %s", diff)
}
})
}