Skip to content

Commit

Permalink
Add test cases for JSON resource marshaling (#1925)
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar23sj authored Jul 8, 2021
1 parent 670f4d7 commit c2dfd88
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions github/apps_installation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit c2dfd88

Please sign in to comment.