Skip to content
Merged
Prev Previous commit
Next Next commit
Resource Tested for JSON marshalling : GistStats
  • Loading branch information
sagar23sj committed Jun 24, 2021
commit faaf6622fdad6c968c963818dcd396e6003c7364
18 changes: 18 additions & 0 deletions github/admin_stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,3 +335,21 @@ func TestUserStats_Marshal(t *testing.T) {

testJSONMarshal(t, u, want)
}

func TestGistStats_Marshal(t *testing.T) {
testJSONMarshal(t, &GistStats{}, "{}")

u := &GistStats{
TotalGists: Int(1),
PrivateGists: Int(1),
PublicGists: Int(1),
}

want := `{
"total_gists": 1,
"private_gists": 1,
"public_gists": 1
}`

testJSONMarshal(t, u, want)
}