@@ -79,7 +79,7 @@ func TestReactionsService_ListCommentReactions(t *testing.T) {
79
79
fmt .Fprint (w , `[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]` )
80
80
})
81
81
82
- opt := & ListCommentReactionOptions {Content : "+1" }
82
+ opt := & ListReactionOptions {Content : "+1" }
83
83
ctx := context .Background ()
84
84
reactions , _ , err := client .Reactions .ListCommentReactions (ctx , "o" , "r" , 1 , opt )
85
85
if err != nil {
@@ -149,13 +149,15 @@ func TestReactionsService_ListIssueReactions(t *testing.T) {
149
149
mux .HandleFunc ("/repos/o/r/issues/1/reactions" , func (w http.ResponseWriter , r * http.Request ) {
150
150
testMethod (t , r , "GET" )
151
151
testHeader (t , r , "Accept" , mediaTypeReactionsPreview )
152
+ testFormValues (t , r , values {"content" : "+1" })
152
153
153
154
w .WriteHeader (http .StatusOK )
154
155
assertWrite (t , w , []byte (`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]` ))
155
156
})
156
157
158
+ opt := & ListReactionOptions {Content : "+1" }
157
159
ctx := context .Background ()
158
- got , _ , err := client .Reactions .ListIssueReactions (ctx , "o" , "r" , 1 , nil )
160
+ got , _ , err := client .Reactions .ListIssueReactions (ctx , "o" , "r" , 1 , opt )
159
161
if err != nil {
160
162
t .Errorf ("ListIssueReactions returned error: %v" , err )
161
163
}
@@ -173,7 +175,7 @@ func TestReactionsService_ListIssueReactions_coverage(t *testing.T) {
173
175
174
176
const methodName = "ListIssueReactions"
175
177
testBadOptions (t , methodName , func () (err error ) {
176
- _ , _ , err = client .Reactions .ListIssueReactions (ctx , "\n " , "\n " , - 1 , & ListOptions {})
178
+ _ , _ , err = client .Reactions .ListIssueReactions (ctx , "\n " , "\n " , - 1 , & ListReactionOptions {})
177
179
return err
178
180
})
179
181
@@ -230,13 +232,15 @@ func TestReactionsService_ListIssueCommentReactions(t *testing.T) {
230
232
mux .HandleFunc ("/repos/o/r/issues/comments/1/reactions" , func (w http.ResponseWriter , r * http.Request ) {
231
233
testMethod (t , r , "GET" )
232
234
testHeader (t , r , "Accept" , mediaTypeReactionsPreview )
235
+ testFormValues (t , r , values {"content" : "+1" })
233
236
234
237
w .WriteHeader (http .StatusOK )
235
238
assertWrite (t , w , []byte (`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]` ))
236
239
})
237
240
241
+ opt := & ListReactionOptions {Content : "+1" }
238
242
ctx := context .Background ()
239
- got , _ , err := client .Reactions .ListIssueCommentReactions (ctx , "o" , "r" , 1 , nil )
243
+ got , _ , err := client .Reactions .ListIssueCommentReactions (ctx , "o" , "r" , 1 , opt )
240
244
if err != nil {
241
245
t .Errorf ("ListIssueCommentReactions returned error: %v" , err )
242
246
}
@@ -254,7 +258,7 @@ func TestReactionsService_ListIssueCommentReactions_coverage(t *testing.T) {
254
258
255
259
const methodName = "ListIssueCommentReactions"
256
260
testBadOptions (t , methodName , func () (err error ) {
257
- _ , _ , err = client .Reactions .ListIssueCommentReactions (ctx , "\n " , "\n " , - 1 , & ListOptions {})
261
+ _ , _ , err = client .Reactions .ListIssueCommentReactions (ctx , "\n " , "\n " , - 1 , & ListReactionOptions {})
258
262
return err
259
263
})
260
264
@@ -311,13 +315,15 @@ func TestReactionsService_ListPullRequestCommentReactions(t *testing.T) {
311
315
mux .HandleFunc ("/repos/o/r/pulls/comments/1/reactions" , func (w http.ResponseWriter , r * http.Request ) {
312
316
testMethod (t , r , "GET" )
313
317
testHeader (t , r , "Accept" , mediaTypeReactionsPreview )
318
+ testFormValues (t , r , values {"content" : "+1" })
314
319
315
320
w .WriteHeader (http .StatusOK )
316
321
assertWrite (t , w , []byte (`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]` ))
317
322
})
318
323
324
+ opt := & ListReactionOptions {Content : "+1" }
319
325
ctx := context .Background ()
320
- got , _ , err := client .Reactions .ListPullRequestCommentReactions (ctx , "o" , "r" , 1 , nil )
326
+ got , _ , err := client .Reactions .ListPullRequestCommentReactions (ctx , "o" , "r" , 1 , opt )
321
327
if err != nil {
322
328
t .Errorf ("ListPullRequestCommentReactions returned error: %v" , err )
323
329
}
@@ -335,7 +341,7 @@ func TestReactionsService_ListPullRequestCommentReactions_coverage(t *testing.T)
335
341
336
342
const methodName = "ListPullRequestCommentReactions"
337
343
testBadOptions (t , methodName , func () (err error ) {
338
- _ , _ , err = client .Reactions .ListPullRequestCommentReactions (ctx , "\n " , "\n " , - 1 , & ListOptions {})
344
+ _ , _ , err = client .Reactions .ListPullRequestCommentReactions (ctx , "\n " , "\n " , - 1 , & ListReactionOptions {})
339
345
return err
340
346
})
341
347
@@ -392,13 +398,15 @@ func TestReactionsService_ListTeamDiscussionReactions(t *testing.T) {
392
398
mux .HandleFunc ("/teams/1/discussions/2/reactions" , func (w http.ResponseWriter , r * http.Request ) {
393
399
testMethod (t , r , "GET" )
394
400
testHeader (t , r , "Accept" , mediaTypeReactionsPreview )
401
+ testFormValues (t , r , values {"content" : "+1" })
395
402
396
403
w .WriteHeader (http .StatusOK )
397
404
assertWrite (t , w , []byte (`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]` ))
398
405
})
399
406
407
+ opt := & ListReactionOptions {Content : "+1" }
400
408
ctx := context .Background ()
401
- got , _ , err := client .Reactions .ListTeamDiscussionReactions (ctx , 1 , 2 , nil )
409
+ got , _ , err := client .Reactions .ListTeamDiscussionReactions (ctx , 1 , 2 , opt )
402
410
if err != nil {
403
411
t .Errorf ("ListTeamDiscussionReactions returned error: %v" , err )
404
412
}
@@ -416,7 +424,7 @@ func TestReactionsService_ListTeamDiscussionReactions_coverage(t *testing.T) {
416
424
417
425
const methodName = "ListTeamDiscussionReactions"
418
426
testBadOptions (t , methodName , func () (err error ) {
419
- _ , _ , err = client .Reactions .ListTeamDiscussionReactions (ctx , - 1 , - 2 , & ListOptions {})
427
+ _ , _ , err = client .Reactions .ListTeamDiscussionReactions (ctx , - 1 , - 2 , & ListReactionOptions {})
420
428
return err
421
429
})
422
430
@@ -473,13 +481,15 @@ func TestReactionService_ListTeamDiscussionCommentReactions(t *testing.T) {
473
481
mux .HandleFunc ("/teams/1/discussions/2/comments/3/reactions" , func (w http.ResponseWriter , r * http.Request ) {
474
482
testMethod (t , r , "GET" )
475
483
testHeader (t , r , "Accept" , mediaTypeReactionsPreview )
484
+ testFormValues (t , r , values {"content" : "+1" })
476
485
477
486
w .WriteHeader (http .StatusOK )
478
487
assertWrite (t , w , []byte (`[{"id":1,"user":{"login":"l","id":2},"content":"+1"}]` ))
479
488
})
480
489
490
+ opt := & ListReactionOptions {Content : "+1" }
481
491
ctx := context .Background ()
482
- got , _ , err := client .Reactions .ListTeamDiscussionCommentReactions (ctx , 1 , 2 , 3 , nil )
492
+ got , _ , err := client .Reactions .ListTeamDiscussionCommentReactions (ctx , 1 , 2 , 3 , opt )
483
493
if err != nil {
484
494
t .Errorf ("ListTeamDiscussionCommentReactions returned error: %v" , err )
485
495
}
@@ -497,7 +507,7 @@ func TestReactionService_ListTeamDiscussionCommentReactions_coverage(t *testing.
497
507
498
508
const methodName = "ListTeamDiscussionCommentReactions"
499
509
testBadOptions (t , methodName , func () (err error ) {
500
- _ , _ , err = client .Reactions .ListTeamDiscussionCommentReactions (ctx , - 1 , - 2 , - 3 , & ListOptions {})
510
+ _ , _ , err = client .Reactions .ListTeamDiscussionCommentReactions (ctx , - 1 , - 2 , - 3 , & ListReactionOptions {})
501
511
return err
502
512
})
503
513
0 commit comments