File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -953,3 +953,39 @@ func TestCommitResult_Marshal(t *testing.T) {
953953
954954 testJSONMarshal (t , c , want )
955955}
956+
957+ func TestUsersSearchResult_Marshal (t * testing.T ) {
958+ testJSONMarshal (t , & UsersSearchResult {}, "{}" )
959+
960+ u := & UsersSearchResult {
961+ Total : Int (2 ),
962+ IncompleteResults : Bool (false ),
963+ Users : []* User {{
964+ Login : String ("loginTest" ),
965+ ID : Int64 (1 ),
966+ NodeID : String ("NodeTest" ),
967+ AvatarURL : String ("AvatarURLTest" ),
968+ HTMLURL : String ("Hurl" ),
969+ GravatarID : String ("gravatarIDTest" ),
970+ Name : String ("nameTest" ),
971+ }},
972+ }
973+
974+ want := `{
975+ "total_count": 2,
976+ "incomplete_results": false,
977+ "items": [
978+ {
979+ "login": "loginTest",
980+ "id": 1,
981+ "node_id": "NodeTest",
982+ "avatar_url": "AvatarURLTest",
983+ "html_url": "Hurl",
984+ "gravatar_id": "gravatarIDTest",
985+ "name": "nameTest"
986+ }
987+ ]
988+ }`
989+
990+ testJSONMarshal (t , u , want )
991+ }
You can’t perform that action at this time.
0 commit comments