forked from open-networks/go-msgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAttendees_test.go
65 lines (63 loc) · 1.62 KB
/
Attendees_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
package msgraph
import (
"testing"
"time"
)
func TestAttendees_String(t *testing.T) {
tests := []struct {
name string
a Attendees
want string
}{
{
name: "test eq",
a: Attendees{testAttendee1, testAttendee2},
want: "Attendees(Name: Testname, Type: attendee, E-mail: [email protected], ResponseStatus: Response: accepted, Time: " +
testAttendee1.ResponseStatus.Time.Format(time.RFC3339Nano) +
" | Name: Testuser, Type: attendee, E-mail: [email protected], ResponseStatus: Response: declined, Time: " +
testAttendee2.ResponseStatus.Time.Format(time.RFC3339Nano) + ")",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := tt.a.String(); got != tt.want {
t.Errorf("Attendees.String() = %v, want %v", got, tt.want)
}
})
}
}
func TestAttendees_Equal(t *testing.T) {
type args struct {
other Attendees
}
tests := []struct {
name string
a Attendees
args args
want bool
}{
{
name: "Equal, different order",
a: Attendees{testAttendee1, testAttendee2},
args: args{other: Attendees{testAttendee2, testAttendee1}},
want: true,
}, {
name: "non-equal, missing one",
a: Attendees{testAttendee1, testAttendee2},
args: args{other: Attendees{testAttendee1}},
want: false,
}, {
name: "non-equal, too many",
a: Attendees{testAttendee1},
args: args{other: Attendees{testAttendee2, testAttendee1}},
want: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := tt.a.Equal(tt.args.other); got != tt.want {
t.Errorf("Attendees.Equal() = %v, want %v", got, tt.want)
}
})
}
}