@@ -35,6 +35,20 @@ func TestIssuesService_ListLabels(t *testing.T) {
35
35
if ! reflect .DeepEqual (labels , want ) {
36
36
t .Errorf ("Issues.ListLabels returned %+v, want %+v" , labels , want )
37
37
}
38
+
39
+ const methodName = "ListLabels"
40
+ testBadOptions (t , methodName , func () (err error ) {
41
+ _ , _ , err = client .Issues .ListLabels (ctx , "\n " , "\n " , opt )
42
+ return err
43
+ })
44
+
45
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
46
+ got , resp , err := client .Issues .ListLabels (ctx , "o" , "r" , opt )
47
+ if got != nil {
48
+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
49
+ }
50
+ return resp , err
51
+ })
38
52
}
39
53
40
54
func TestIssuesService_ListLabels_invalidOwner (t * testing.T ) {
@@ -65,6 +79,20 @@ func TestIssuesService_GetLabel(t *testing.T) {
65
79
if ! reflect .DeepEqual (label , want ) {
66
80
t .Errorf ("Issues.GetLabel returned %+v, want %+v" , label , want )
67
81
}
82
+
83
+ const methodName = "GetLabel"
84
+ testBadOptions (t , methodName , func () (err error ) {
85
+ _ , _ , err = client .Issues .GetLabel (ctx , "\n " , "\n " , "\n " )
86
+ return err
87
+ })
88
+
89
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
90
+ got , resp , err := client .Issues .GetLabel (ctx , "o" , "r" , "n" )
91
+ if got != nil {
92
+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
93
+ }
94
+ return resp , err
95
+ })
68
96
}
69
97
70
98
func TestIssuesService_GetLabel_invalidOwner (t * testing.T ) {
@@ -104,6 +132,20 @@ func TestIssuesService_CreateLabel(t *testing.T) {
104
132
if ! reflect .DeepEqual (label , want ) {
105
133
t .Errorf ("Issues.CreateLabel returned %+v, want %+v" , label , want )
106
134
}
135
+
136
+ const methodName = "CreateLabel"
137
+ testBadOptions (t , methodName , func () (err error ) {
138
+ _ , _ , err = client .Issues .CreateLabel (ctx , "\n " , "\n " , input )
139
+ return err
140
+ })
141
+
142
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
143
+ got , resp , err := client .Issues .CreateLabel (ctx , "o" , "r" , input )
144
+ if got != nil {
145
+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
146
+ }
147
+ return resp , err
148
+ })
107
149
}
108
150
109
151
func TestIssuesService_CreateLabel_invalidOwner (t * testing.T ) {
@@ -143,6 +185,20 @@ func TestIssuesService_EditLabel(t *testing.T) {
143
185
if ! reflect .DeepEqual (label , want ) {
144
186
t .Errorf ("Issues.EditLabel returned %+v, want %+v" , label , want )
145
187
}
188
+
189
+ const methodName = "EditLabel"
190
+ testBadOptions (t , methodName , func () (err error ) {
191
+ _ , _ , err = client .Issues .EditLabel (ctx , "\n " , "\n " , "\n " , input )
192
+ return err
193
+ })
194
+
195
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
196
+ got , resp , err := client .Issues .EditLabel (ctx , "o" , "r" , "n" , input )
197
+ if got != nil {
198
+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
199
+ }
200
+ return resp , err
201
+ })
146
202
}
147
203
148
204
func TestIssuesService_EditLabel_invalidOwner (t * testing.T ) {
@@ -167,6 +223,16 @@ func TestIssuesService_DeleteLabel(t *testing.T) {
167
223
if err != nil {
168
224
t .Errorf ("Issues.DeleteLabel returned error: %v" , err )
169
225
}
226
+
227
+ const methodName = "DeleteLabel"
228
+ testBadOptions (t , methodName , func () (err error ) {
229
+ _ , err = client .Issues .DeleteLabel (ctx , "\n " , "\n " , "\n " )
230
+ return err
231
+ })
232
+
233
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
234
+ return client .Issues .DeleteLabel (ctx , "o" , "r" , "n" )
235
+ })
170
236
}
171
237
172
238
func TestIssuesService_DeleteLabel_invalidOwner (t * testing.T ) {
@@ -202,6 +268,20 @@ func TestIssuesService_ListLabelsByIssue(t *testing.T) {
202
268
if ! reflect .DeepEqual (labels , want ) {
203
269
t .Errorf ("Issues.ListLabelsByIssue returned %+v, want %+v" , labels , want )
204
270
}
271
+
272
+ const methodName = "ListLabelsByIssue"
273
+ testBadOptions (t , methodName , func () (err error ) {
274
+ _ , _ , err = client .Issues .ListLabelsByIssue (ctx , "\n " , "\n " , - 1 , opt )
275
+ return err
276
+ })
277
+
278
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
279
+ got , resp , err := client .Issues .ListLabelsByIssue (ctx , "o" , "r" , 1 , opt )
280
+ if got != nil {
281
+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
282
+ }
283
+ return resp , err
284
+ })
205
285
}
206
286
207
287
func TestIssuesService_ListLabelsByIssue_invalidOwner (t * testing.T ) {
@@ -241,6 +321,20 @@ func TestIssuesService_AddLabelsToIssue(t *testing.T) {
241
321
if ! reflect .DeepEqual (labels , want ) {
242
322
t .Errorf ("Issues.AddLabelsToIssue returned %+v, want %+v" , labels , want )
243
323
}
324
+
325
+ const methodName = "AddLabelsToIssue"
326
+ testBadOptions (t , methodName , func () (err error ) {
327
+ _ , _ , err = client .Issues .AddLabelsToIssue (ctx , "\n " , "\n " , - 1 , input )
328
+ return err
329
+ })
330
+
331
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
332
+ got , resp , err := client .Issues .AddLabelsToIssue (ctx , "o" , "r" , 1 , input )
333
+ if got != nil {
334
+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
335
+ }
336
+ return resp , err
337
+ })
244
338
}
245
339
246
340
func TestIssuesService_AddLabelsToIssue_invalidOwner (t * testing.T ) {
@@ -265,6 +359,16 @@ func TestIssuesService_RemoveLabelForIssue(t *testing.T) {
265
359
if err != nil {
266
360
t .Errorf ("Issues.RemoveLabelForIssue returned error: %v" , err )
267
361
}
362
+
363
+ const methodName = "RemoveLabelForIssue"
364
+ testBadOptions (t , methodName , func () (err error ) {
365
+ _ , err = client .Issues .RemoveLabelForIssue (ctx , "\n " , "\n " , - 1 , "\n " )
366
+ return err
367
+ })
368
+
369
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
370
+ return client .Issues .RemoveLabelForIssue (ctx , "o" , "r" , 1 , "l" )
371
+ })
268
372
}
269
373
270
374
func TestIssuesService_RemoveLabelForIssue_invalidOwner (t * testing.T ) {
@@ -304,6 +408,20 @@ func TestIssuesService_ReplaceLabelsForIssue(t *testing.T) {
304
408
if ! reflect .DeepEqual (labels , want ) {
305
409
t .Errorf ("Issues.ReplaceLabelsForIssue returned %+v, want %+v" , labels , want )
306
410
}
411
+
412
+ const methodName = "ReplaceLabelsForIssue"
413
+ testBadOptions (t , methodName , func () (err error ) {
414
+ _ , _ , err = client .Issues .ReplaceLabelsForIssue (ctx , "\n " , "\n " , - 1 , input )
415
+ return err
416
+ })
417
+
418
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
419
+ got , resp , err := client .Issues .ReplaceLabelsForIssue (ctx , "o" , "r" , 1 , input )
420
+ if got != nil {
421
+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
422
+ }
423
+ return resp , err
424
+ })
307
425
}
308
426
309
427
func TestIssuesService_ReplaceLabelsForIssue_invalidOwner (t * testing.T ) {
@@ -328,6 +446,16 @@ func TestIssuesService_RemoveLabelsForIssue(t *testing.T) {
328
446
if err != nil {
329
447
t .Errorf ("Issues.RemoveLabelsForIssue returned error: %v" , err )
330
448
}
449
+
450
+ const methodName = "RemoveLabelsForIssue"
451
+ testBadOptions (t , methodName , func () (err error ) {
452
+ _ , err = client .Issues .RemoveLabelsForIssue (ctx , "\n " , "\n " , - 1 )
453
+ return err
454
+ })
455
+
456
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
457
+ return client .Issues .RemoveLabelsForIssue (ctx , "o" , "r" , 1 )
458
+ })
331
459
}
332
460
333
461
func TestIssuesService_RemoveLabelsForIssue_invalidOwner (t * testing.T ) {
@@ -360,6 +488,20 @@ func TestIssuesService_ListLabelsForMilestone(t *testing.T) {
360
488
if ! reflect .DeepEqual (labels , want ) {
361
489
t .Errorf ("Issues.ListLabelsForMilestone returned %+v, want %+v" , labels , want )
362
490
}
491
+
492
+ const methodName = "ListLabelsForMilestone"
493
+ testBadOptions (t , methodName , func () (err error ) {
494
+ _ , _ , err = client .Issues .ListLabelsForMilestone (ctx , "\n " , "\n " , - 1 , opt )
495
+ return err
496
+ })
497
+
498
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
499
+ got , resp , err := client .Issues .ListLabelsForMilestone (ctx , "o" , "r" , 1 , opt )
500
+ if got != nil {
501
+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
502
+ }
503
+ return resp , err
504
+ })
363
505
}
364
506
365
507
func TestIssuesService_ListLabelsForMilestone_invalidOwner (t * testing.T ) {
0 commit comments