@@ -36,6 +36,20 @@ func TestOrganizationsService_ListProjects(t *testing.T) {
36
36
if ! reflect .DeepEqual (projects , want ) {
37
37
t .Errorf ("Organizations.ListProjects returned %+v, want %+v" , projects , want )
38
38
}
39
+
40
+ const methodName = "ListProjects"
41
+ testBadOptions (t , methodName , func () (err error ) {
42
+ _ , _ , err = client .Organizations .ListProjects (ctx , "\n " , opt )
43
+ return err
44
+ })
45
+
46
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
47
+ got , resp , err := client .Organizations .ListProjects (ctx , "o" , opt )
48
+ if got != nil {
49
+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
50
+ }
51
+ return resp , err
52
+ })
39
53
}
40
54
41
55
func TestOrganizationsService_CreateProject (t * testing.T ) {
@@ -67,4 +81,18 @@ func TestOrganizationsService_CreateProject(t *testing.T) {
67
81
if ! reflect .DeepEqual (project , want ) {
68
82
t .Errorf ("Organizations.CreateProject returned %+v, want %+v" , project , want )
69
83
}
84
+
85
+ const methodName = "CreateProject"
86
+ testBadOptions (t , methodName , func () (err error ) {
87
+ _ , _ , err = client .Organizations .CreateProject (ctx , "\n " , input )
88
+ return err
89
+ })
90
+
91
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
92
+ got , resp , err := client .Organizations .CreateProject (ctx , "o" , input )
93
+ if got != nil {
94
+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
95
+ }
96
+ return resp , err
97
+ })
70
98
}
0 commit comments