Skip to content

Commit 3b74056

Browse files
committed
Resource Tested for JSON marshalling : FeedLinks
1 parent b0bda7a commit 3b74056

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

github/activity_test.go

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,3 +236,75 @@ func TestFeeds_Marshal(t *testing.T) {
236236

237237
testJSONMarshal(t, u, want)
238238
}
239+
240+
func TestFeedLinks_Marshal(t *testing.T) {
241+
testJSONMarshal(t, &FeedLinks{}, "{}")
242+
243+
u := &FeedLinks{
244+
Timeline: &FeedLink{
245+
HRef: String("h"),
246+
Type: String("t"),
247+
},
248+
User: &FeedLink{
249+
HRef: String("h"),
250+
Type: String("t"),
251+
},
252+
CurrentUserPublic: &FeedLink{
253+
HRef: String("h"),
254+
Type: String("t"),
255+
},
256+
CurrentUser: &FeedLink{
257+
HRef: String("h"),
258+
Type: String("t"),
259+
},
260+
CurrentUserActor: &FeedLink{
261+
HRef: String("h"),
262+
Type: String("t"),
263+
},
264+
CurrentUserOrganization: &FeedLink{
265+
HRef: String("h"),
266+
Type: String("t"),
267+
},
268+
CurrentUserOrganizations: []*FeedLink{
269+
{
270+
HRef: String("h"),
271+
Type: String("t"),
272+
},
273+
},
274+
}
275+
276+
want := `{
277+
"timeline": {
278+
"href": "h",
279+
"type": "t"
280+
},
281+
"user": {
282+
"href": "h",
283+
"type": "t"
284+
},
285+
"current_user_public": {
286+
"href": "h",
287+
"type": "t"
288+
},
289+
"current_user": {
290+
"href": "h",
291+
"type": "t"
292+
},
293+
"current_user_actor": {
294+
"href": "h",
295+
"type": "t"
296+
},
297+
"current_user_organization": {
298+
"href": "h",
299+
"type": "t"
300+
},
301+
"current_user_organizations": [
302+
{
303+
"href": "h",
304+
"type": "t"
305+
}
306+
]
307+
}`
308+
309+
testJSONMarshal(t, u, want)
310+
}

0 commit comments

Comments
 (0)