Skip to content

Commit 0992892

Browse files
committed
Resource Tested for JSON marshalling : Enterprise
1 parent 4829340 commit 0992892

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

github/admin_test.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,35 @@ func TestUserLDAPMapping_Marshal(t *testing.T) {
235235

236236
testJSONMarshal(t, u, want)
237237
}
238+
239+
func TestEnterprise_Marshal(t *testing.T) {
240+
testJSONMarshal(t, &Enterprise{}, "{}")
241+
242+
u := &Enterprise{
243+
ID: Int(1),
244+
Slug: String("s"),
245+
Name: String("n"),
246+
NodeID: String("nid"),
247+
AvatarURL: String("au"),
248+
Description: String("d"),
249+
WebsiteURL: String("wu"),
250+
HTMLURL: String("hu"),
251+
CreatedAt: &Timestamp{referenceTime},
252+
UpdatedAt: &Timestamp{referenceTime},
253+
}
254+
255+
want := `{
256+
"id": 1,
257+
"slug": "s",
258+
"name": "n",
259+
"node_id": "nid",
260+
"avatar_url": "au",
261+
"description": "d",
262+
"website_url": "wu",
263+
"html_url": "hu",
264+
"created_at": ` + referenceTimeStr + `,
265+
"updated_at": ` + referenceTimeStr + `
266+
}`
267+
268+
testJSONMarshal(t, u, want)
269+
}

0 commit comments

Comments
 (0)