MCPcopy Index your code
hub / github.com/google/go-github / TestAcceptedAssignment_Marshal

Function TestAcceptedAssignment_Marshal

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

Source from the content-addressed store, hash-verified

115}
116
117func TestAcceptedAssignment_Marshal(t *testing.T) {
118 t.Parallel()
119 testJSONMarshal(t, &AcceptedAssignment{}, "{}")
120
121 a := &AcceptedAssignment{
122 ID: Ptr(int64(42)),
123 Submitted: Ptr(true),
124 Passing: Ptr(true),
125 CommitCount: Ptr(5),
126 Grade: Ptr("10/10"),
127 Students: []*ClassroomUser{
128 {
129 ID: Ptr(int64(1)),
130 Login: Ptr("octocat"),
131 AvatarURL: Ptr("https://github.com/images/error/octocat_happy.gif"),
132 HTMLURL: Ptr("https://github.com/octocat"),
133 },
134 },
135 Repository: &Repository{
136 ID: Ptr(int64(1296269)),
137 FullName: Ptr("octocat/Hello-World"),
138 HTMLURL: Ptr("https://github.com/octocat/Hello-World"),
139 NodeID: Ptr("MDEwOlJlcG9zaXRvcnkxMjk2MjY5"),
140 Private: Ptr(false),
141 DefaultBranch: Ptr("main"),
142 },
143 Assignment: &ClassroomAssignment{
144 ID: Ptr(int64(12)),
145 PublicRepo: Ptr(false),
146 Title: Ptr("Intro to Binaries"),
147 Type: Ptr("individual"),
148 InviteLink: Ptr("https://example.com/a/Lx7jiUgx"),
149 InvitationsEnabled: Ptr(true),
150 Slug: Ptr("intro-to-binaries"),
151 StudentsAreRepoAdmins: Ptr(false),
152 FeedbackPullRequestsEnabled: Ptr(true),
153 MaxTeams: Ptr(0),
154 MaxMembers: Ptr(0),
155 Editor: Ptr("codespaces"),
156 Accepted: Ptr(100),
157 Submitted: Ptr(40),
158 Passing: Ptr(10),
159 Language: Ptr("ruby"),
160 Deadline: &Timestamp{referenceTime},
161 Classroom: &Classroom{
162 ID: Ptr(int64(1296269)),
163 Name: Ptr("Programming Elixir"),
164 Archived: Ptr(false),
165 URL: Ptr("https://example.com/classrooms/programming"),
166 },
167 },
168 }
169
170 want := `{
171 "id": 42,
172 "submitted": true,
173 "passing": true,
174 "commit_count": 5,

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…