File tree Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -309,3 +309,57 @@ func TestStarredRepository_Marshal(t *testing.T) {
309309
310310 testJSONMarshal (t , u , want )
311311}
312+
313+ func TestStargazer_Marshal (t * testing.T ) {
314+ testJSONMarshal (t , & Stargazer {}, "{}" )
315+
316+ u := & Stargazer {
317+ StarredAt : & Timestamp {referenceTime },
318+ User : & User {
319+ Login : String ("l" ),
320+ ID : Int64 (1 ),
321+ URL : String ("u" ),
322+ AvatarURL : String ("a" ),
323+ GravatarID : String ("g" ),
324+ Name : String ("n" ),
325+ Company : String ("c" ),
326+ Blog : String ("b" ),
327+ Location : String ("l" ),
328+ Email : String ("e" ),
329+ Hireable : Bool (true ),
330+ Bio : String ("b" ),
331+ TwitterUsername : String ("t" ),
332+ PublicRepos : Int (1 ),
333+ Followers : Int (1 ),
334+ Following : Int (1 ),
335+ CreatedAt : & Timestamp {referenceTime },
336+ SuspendedAt : & Timestamp {referenceTime },
337+ },
338+ }
339+
340+ want := `{
341+ "starred_at": ` + referenceTimeStr + `,
342+ "user": {
343+ "login": "l",
344+ "id": 1,
345+ "avatar_url": "a",
346+ "gravatar_id": "g",
347+ "name": "n",
348+ "company": "c",
349+ "blog": "b",
350+ "location": "l",
351+ "email": "e",
352+ "hireable": true,
353+ "bio": "b",
354+ "twitter_username": "t",
355+ "public_repos": 1,
356+ "followers": 1,
357+ "following": 1,
358+ "created_at": ` + referenceTimeStr + `,
359+ "suspended_at": ` + referenceTimeStr + `,
360+ "url": "u"
361+ }
362+ }`
363+
364+ testJSONMarshal (t , u , want )
365+ }
You can’t perform that action at this time.
0 commit comments