Skip to content

Commit c2dfd88

Browse files
authored
Add test cases for JSON resource marshaling (#1925)
1 parent 670f4d7 commit c2dfd88

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

github/apps_installation_test.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,29 @@ func TestAppsService_RevokeInstallationToken(t *testing.T) {
173173
return client.Apps.RevokeInstallationToken(ctx)
174174
})
175175
}
176+
177+
func TestListRepositories_Marshal(t *testing.T) {
178+
testJSONMarshal(t, &ListRepositories{}, "{}")
179+
180+
u := &ListRepositories{
181+
TotalCount: Int(1),
182+
Repositories: []*Repository{
183+
{
184+
ID: Int64(1),
185+
URL: String("u"),
186+
Name: String("n"),
187+
},
188+
},
189+
}
190+
191+
want := `{
192+
"total_count": 1,
193+
"repositories": [{
194+
"id":1,
195+
"name":"n",
196+
"url":"u"
197+
}]
198+
}`
199+
200+
testJSONMarshal(t, u, want)
201+
}

0 commit comments

Comments
 (0)