Skip to content

Commit f8c6e53

Browse files
authored
Improve apps_marketplace.go coverage (google#1685)
1 parent 11ee535 commit f8c6e53

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

github/apps_marketplace_test.go

+36
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ func TestMarketplaceService_ListPlans(t *testing.T) {
3838
if !reflect.DeepEqual(plans, want) {
3939
t.Errorf("Marketplace.ListPlans returned %+v, want %+v", plans, want)
4040
}
41+
42+
const methodName = "ListPlans"
43+
testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
44+
got, resp, err := client.Marketplace.ListPlans(ctx, opt)
45+
if got != nil {
46+
t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
47+
}
48+
return resp, err
49+
})
4150
}
4251

4352
func TestMarketplaceService_Stubbed_ListPlans(t *testing.T) {
@@ -84,6 +93,15 @@ func TestMarketplaceService_ListPlanAccountsForPlan(t *testing.T) {
8493
if !reflect.DeepEqual(accounts, want) {
8594
t.Errorf("Marketplace.ListPlanAccountsForPlan returned %+v, want %+v", accounts, want)
8695
}
96+
97+
const methodName = "ListPlanAccountsForPlan"
98+
testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
99+
got, resp, err := client.Marketplace.ListPlanAccountsForPlan(ctx, 1, opt)
100+
if got != nil {
101+
t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
102+
}
103+
return resp, err
104+
})
87105
}
88106

89107
func TestMarketplaceService_Stubbed_ListPlanAccountsForPlan(t *testing.T) {
@@ -130,6 +148,15 @@ func TestMarketplaceService_ListPlanAccountsForAccount(t *testing.T) {
130148
if !reflect.DeepEqual(accounts, want) {
131149
t.Errorf("Marketplace.ListPlanAccountsForAccount returned %+v, want %+v", accounts, want)
132150
}
151+
152+
const methodName = "ListPlanAccountsForAccount"
153+
testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
154+
got, resp, err := client.Marketplace.ListPlanAccountsForAccount(ctx, 1, opt)
155+
if got != nil {
156+
t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
157+
}
158+
return resp, err
159+
})
133160
}
134161

135162
func TestMarketplaceService_Stubbed_ListPlanAccountsForAccount(t *testing.T) {
@@ -176,6 +203,15 @@ func TestMarketplaceService_ListMarketplacePurchasesForUser(t *testing.T) {
176203
if !reflect.DeepEqual(purchases, want) {
177204
t.Errorf("Marketplace.ListMarketplacePurchasesForUser returned %+v, want %+v", purchases, want)
178205
}
206+
207+
const methodName = "ListMarketplacePurchasesForUser"
208+
testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
209+
got, resp, err := client.Marketplace.ListMarketplacePurchasesForUser(ctx, opt)
210+
if got != nil {
211+
t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
212+
}
213+
return resp, err
214+
})
179215
}
180216

181217
func TestMarketplaceService_Stubbed_ListMarketplacePurchasesForUser(t *testing.T) {

0 commit comments

Comments
 (0)