MCPcopy Create free account
hub / github.com/google/go-github / TestClassroom_Marshal

Function TestClassroom_Marshal

github/classroom_test.go:17–52  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

15)
16
17func TestClassroom_Marshal(t *testing.T) {
18 t.Parallel()
19 testJSONMarshal(t, &Classroom{}, "{}")
20
21 c := &Classroom{
22 ID: Ptr(int64(1296269)),
23 Name: Ptr("Programming Elixir"),
24 Archived: Ptr(false),
25 Organization: &Organization{
26 ID: Ptr(int64(1)),
27 Login: Ptr("programming-elixir"),
28 NodeID: Ptr("MDEyOk9yZ2FuaXphdGlvbjE="),
29 HTMLURL: Ptr("https://example.com/programming-elixir"),
30 Name: Ptr("Learn how to build fault tolerant applications"),
31 AvatarURL: Ptr("https://example.com/avatars/u/9919?v=4"),
32 },
33 URL: Ptr("https://example.com/classrooms/programming"),
34 }
35
36 want := `{
37 "id": 1296269,
38 "name": "Programming Elixir",
39 "archived": false,
40 "organization": {
41 "id": 1,
42 "login": "programming-elixir",
43 "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
44 "html_url": "https://example.com/programming-elixir",
45 "name": "Learn how to build fault tolerant applications",
46 "avatar_url": "https://example.com/avatars/u/9919?v=4"
47 },
48 "url": "https://example.com/classrooms/programming"
49 }`
50
51 testJSONMarshal(t, c, want)
52}
53
54func TestClassroomAssignment_Marshal(t *testing.T) {
55 t.Parallel()

Callers

nothing calls this directly

Calls 2

testJSONMarshalFunction · 0.85
PtrFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…