diff --git a/github/apps_installation_test.go b/github/apps_installation_test.go index 563e0d2fa16..56f0ad9e81d 100644 --- a/github/apps_installation_test.go +++ b/github/apps_installation_test.go @@ -173,3 +173,29 @@ func TestAppsService_RevokeInstallationToken(t *testing.T) { return client.Apps.RevokeInstallationToken(ctx) }) } + +func TestListRepositories_Marshal(t *testing.T) { + testJSONMarshal(t, &ListRepositories{}, "{}") + + u := &ListRepositories{ + TotalCount: Int(1), + Repositories: []*Repository{ + { + ID: Int64(1), + URL: String("u"), + Name: String("n"), + }, + }, + } + + want := `{ + "total_count": 1, + "repositories": [{ + "id":1, + "name":"n", + "url":"u" + }] + }` + + testJSONMarshal(t, u, want) +}