@@ -43,6 +43,15 @@ func TestSubIssuesService_Add(t *testing.T) {
4343 if ! cmp .Equal (got , want ) {
4444 t .Errorf ("SubIssues.Add = %+v, want %+v" , got , want )
4545 }
46+
47+ const methodName = "Add"
48+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
49+ got , resp , err := client .SubIssue .Add (ctx , "o" , "r" , 1 , input )
50+ if got != nil {
51+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
52+ }
53+ return resp , err
54+ })
4655}
4756
4857func TestSubIssuesService_ListByIssue (t * testing.T ) {
@@ -67,6 +76,20 @@ func TestSubIssuesService_ListByIssue(t *testing.T) {
6776 if ! cmp .Equal (issues , want ) {
6877 t .Errorf ("SubIssues.ListByIssue = %+v, want %+v" , issues , want )
6978 }
79+
80+ const methodName = "ListByIssue"
81+ testBadOptions (t , methodName , func () (err error ) {
82+ _ , _ , err = client .SubIssue .ListByIssue (ctx , "\n " , "\n " , 1 , opt )
83+ return err
84+ })
85+
86+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
87+ got , resp , err := client .SubIssue .ListByIssue (ctx , "o" , "r" , 1 , opt )
88+ if got != nil {
89+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
90+ }
91+ return resp , err
92+ })
7093}
7194
7295func TestSubIssuesService_Remove (t * testing.T ) {
@@ -99,13 +122,22 @@ func TestSubIssuesService_Remove(t *testing.T) {
99122 if ! cmp .Equal (got , want ) {
100123 t .Errorf ("SubIssues.Remove = %+v, want %+v" , got , want )
101124 }
125+
126+ const methodName = "Remove"
127+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
128+ got , resp , err := client .SubIssue .Remove (ctx , "o" , "r" , 1 , input )
129+ if got != nil {
130+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
131+ }
132+ return resp , err
133+ })
102134}
103135
104136func TestSubIssuesService_Reprioritize (t * testing.T ) {
105137 t .Parallel ()
106138 client , mux , _ := setup (t )
107139
108- input := & SubIssueRequest {SubIssueID : 42 , AfterID : 5 }
140+ input := & SubIssueRequest {SubIssueID : 42 , AfterID : Int64 ( 5 ) }
109141
110142 mux .HandleFunc ("/repos/o/r/issues/1/sub_issues/priority" , func (w http.ResponseWriter , r * http.Request ) {
111143 testMethod (t , r , "PATCH" )
@@ -132,4 +164,14 @@ func TestSubIssuesService_Reprioritize(t *testing.T) {
132164 if ! cmp .Equal (got , want ) {
133165 t .Errorf ("SubIssues.Reprioritize = %+v, want %+v" , got , want )
134166 }
167+
168+ const methodName = "Reprioritize"
169+
170+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
171+ got , resp , err := client .SubIssue .Reprioritize (ctx , "o" , "r" , 1 , input )
172+ if got != nil {
173+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
174+ }
175+ return resp , err
176+ })
135177}
0 commit comments