@@ -44,6 +44,20 @@ func TestIssuesService_ListComments_allIssues(t *testing.T) {
44
44
if ! reflect .DeepEqual (comments , want ) {
45
45
t .Errorf ("Issues.ListComments returned %+v, want %+v" , comments , want )
46
46
}
47
+
48
+ const methodName = "ListComments"
49
+ testBadOptions (t , methodName , func () (err error ) {
50
+ _ , _ , err = client .Issues .ListComments (ctx , "\n " , "\n " , - 1 , opt )
51
+ return err
52
+ })
53
+
54
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
55
+ got , resp , err := client .Issues .ListComments (ctx , "o" , "r" , 0 , opt )
56
+ if got != nil {
57
+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
58
+ }
59
+ return resp , err
60
+ })
47
61
}
48
62
49
63
func TestIssuesService_ListComments_specificIssue (t * testing.T ) {
@@ -66,6 +80,20 @@ func TestIssuesService_ListComments_specificIssue(t *testing.T) {
66
80
if ! reflect .DeepEqual (comments , want ) {
67
81
t .Errorf ("Issues.ListComments returned %+v, want %+v" , comments , want )
68
82
}
83
+
84
+ const methodName = "ListComments"
85
+ testBadOptions (t , methodName , func () (err error ) {
86
+ _ , _ , err = client .Issues .ListComments (ctx , "\n " , "\n " , - 1 , nil )
87
+ return err
88
+ })
89
+
90
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
91
+ got , resp , err := client .Issues .ListComments (ctx , "o" , "r" , 1 , nil )
92
+ if got != nil {
93
+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
94
+ }
95
+ return resp , err
96
+ })
69
97
}
70
98
71
99
func TestIssuesService_ListComments_invalidOwner (t * testing.T ) {
@@ -97,6 +125,20 @@ func TestIssuesService_GetComment(t *testing.T) {
97
125
if ! reflect .DeepEqual (comment , want ) {
98
126
t .Errorf ("Issues.GetComment returned %+v, want %+v" , comment , want )
99
127
}
128
+
129
+ const methodName = "GetComment"
130
+ testBadOptions (t , methodName , func () (err error ) {
131
+ _ , _ , err = client .Issues .GetComment (ctx , "\n " , "\n " , - 1 )
132
+ return err
133
+ })
134
+
135
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
136
+ got , resp , err := client .Issues .GetComment (ctx , "o" , "r" , 1 )
137
+ if got != nil {
138
+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
139
+ }
140
+ return resp , err
141
+ })
100
142
}
101
143
102
144
func TestIssuesService_GetComment_invalidOrg (t * testing.T ) {
@@ -136,6 +178,20 @@ func TestIssuesService_CreateComment(t *testing.T) {
136
178
if ! reflect .DeepEqual (comment , want ) {
137
179
t .Errorf ("Issues.CreateComment returned %+v, want %+v" , comment , want )
138
180
}
181
+
182
+ const methodName = "CreateComment"
183
+ testBadOptions (t , methodName , func () (err error ) {
184
+ _ , _ , err = client .Issues .CreateComment (ctx , "\n " , "\n " , - 1 , input )
185
+ return err
186
+ })
187
+
188
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
189
+ got , resp , err := client .Issues .CreateComment (ctx , "o" , "r" , 1 , input )
190
+ if got != nil {
191
+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
192
+ }
193
+ return resp , err
194
+ })
139
195
}
140
196
141
197
func TestIssuesService_CreateComment_invalidOrg (t * testing.T ) {
@@ -175,6 +231,20 @@ func TestIssuesService_EditComment(t *testing.T) {
175
231
if ! reflect .DeepEqual (comment , want ) {
176
232
t .Errorf ("Issues.EditComment returned %+v, want %+v" , comment , want )
177
233
}
234
+
235
+ const methodName = "EditComment"
236
+ testBadOptions (t , methodName , func () (err error ) {
237
+ _ , _ , err = client .Issues .EditComment (ctx , "\n " , "\n " , - 1 , input )
238
+ return err
239
+ })
240
+
241
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
242
+ got , resp , err := client .Issues .EditComment (ctx , "o" , "r" , 1 , input )
243
+ if got != nil {
244
+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
245
+ }
246
+ return resp , err
247
+ })
178
248
}
179
249
180
250
func TestIssuesService_EditComment_invalidOwner (t * testing.T ) {
@@ -199,6 +269,16 @@ func TestIssuesService_DeleteComment(t *testing.T) {
199
269
if err != nil {
200
270
t .Errorf ("Issues.DeleteComments returned error: %v" , err )
201
271
}
272
+
273
+ const methodName = "DeleteComment"
274
+ testBadOptions (t , methodName , func () (err error ) {
275
+ _ , err = client .Issues .DeleteComment (ctx , "\n " , "\n " , - 1 )
276
+ return err
277
+ })
278
+
279
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
280
+ return client .Issues .DeleteComment (ctx , "o" , "r" , 1 )
281
+ })
202
282
}
203
283
204
284
func TestIssuesService_DeleteComment_invalidOwner (t * testing.T ) {
0 commit comments