-
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
-
66
-
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
-
131
-
132
-
133
-
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
-
148
-
149
package activitypub
import "testing"
func TestItemCollection_Append(t *testing.T) {
t.Skipf("TODO")
}
func TestItemCollection_Collection(t *testing.T) {
t.Skipf("TODO")
}
func TestItemCollection_GetID(t *testing.T) {
t.Skipf("TODO")
}
func TestItemCollection_GetLink(t *testing.T) {
t.Skipf("TODO")
}
func TestItemCollection_GetType(t *testing.T) {
t.Skipf("TODO")
}
func TestItemCollection_IsLink(t *testing.T) {
t.Skipf("TODO")
}
func TestItemCollection_IsObject(t *testing.T) {
t.Skipf("TODO")
}
func TestItemCollection_First(t *testing.T) {
t.Skipf("TODO")
}
func TestItemCollection_Count(t *testing.T) {
t.Skipf("TODO")
}
func TestItemCollection_Contains(t *testing.T) {
t.Skipf("TODO")
}
func TestItemCollection_IsCollection(t *testing.T) {
t.Skipf("TODO")
}
func TestToItemCollection(t *testing.T) {
t.Skipf("TODO")
}
func TestItemCollection_Remove(t *testing.T) {
tests := []struct {
name string
i ItemCollection
arg Item
}{
{
name: "empty_collection_nil_item",
i: ItemCollection{},
arg: nil,
},
{
name: "empty_collection_non_nil_item",
i: ItemCollection{},
arg: &Object{},
},
{
name: "non_empty_collection_nil_item",
i: ItemCollection{
&Object{ID: "test"},
},
arg: nil,
},
{
name: "non_empty_collection_non_contained_item_empty_ID",
i: ItemCollection{
&Object{ID: "test"},
},
arg: &Object{},
},
{
name: "non_empty_collection_non_contained_item",
i: ItemCollection{
&Object{ID: "test"},
},
arg: &Object{ID: "test123"},
},
{
name: "non_empty_collection_just_contained_item",
i: ItemCollection{
&Object{ID: "test"},
},
arg: &Object{ID: "test"},
},
{
name: "non_empty_collection_contained_item_first_pos",
i: ItemCollection{
&Object{ID: "test"},
&Object{ID: "test123"},
},
arg: &Object{ID: "test"},
},
{
name: "non_empty_collection_contained_item_not_first_pos",
i: ItemCollection{
&Object{ID: "test123"},
&Object{ID: "test"},
&Object{ID: "test321"},
},
arg: &Object{ID: "test"},
},
{
name: "non_empty_collection_contained_item_last_pos",
i: ItemCollection{
&Object{ID: "test123"},
&Object{ID: "test"},
},
arg: &Object{ID: "test"},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
origContains := tt.i.Contains(tt.arg)
origLen := tt.i.Count()
should := ""
does := "n't"
if origContains {
should = "n't"
does = ""
}
tt.i.Remove(tt.arg)
if tt.i.Contains(tt.arg) {
t.Errorf("%T should%s contain %T, but it does%s: %#v", tt.i, should, tt.arg, does, tt.i)
}
if origContains {
if tt.i.Count() > origLen-1 {
t.Errorf("%T should have a count lower than %d, got %d", tt.i, origLen, tt.i.Count())
}
} else {
if tt.i.Count() != origLen {
t.Errorf("%T should have a count equal to %d, got %d", tt.i, origLen, tt.i.Count())
}
}
})
}
}