Skip to content

Commit cbba2b0

Browse files
author
sushmita wable
authored
Add test cases for JSON resource marshaling (#2189)
1 parent 103b67c commit cbba2b0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

github/users_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,3 +407,23 @@ func TestHovercard_Marshal(t *testing.T) {
407407

408408
testJSONMarshal(t, h, want)
409409
}
410+
411+
func TestUserListOptions_Marshal(t *testing.T) {
412+
testJSONMarshal(t, &UserListOptions{}, "{}")
413+
414+
u := &UserListOptions{
415+
Since: int64(1900),
416+
ListOptions: ListOptions{
417+
Page: int(1),
418+
PerPage: int(10),
419+
},
420+
}
421+
422+
want := `{
423+
"since" : 1900,
424+
"page": 1,
425+
"perPage": 10
426+
}`
427+
428+
testJSONMarshal(t, u, want)
429+
}

0 commit comments

Comments
 (0)