From 8cc03540dffe9bf73692c4d34edc4446f3184334 Mon Sep 17 00:00:00 2001 From: Haihan Jiang Date: Mon, 25 May 2026 22:09:18 -0700 Subject: [PATCH] test: Cover ClassroomUser JSON marshaling --- github/classroom_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/github/classroom_test.go b/github/classroom_test.go index 7e86430a919..fc34d6397d7 100644 --- a/github/classroom_test.go +++ b/github/classroom_test.go @@ -51,6 +51,27 @@ func TestClassroom_Marshal(t *testing.T) { testJSONMarshal(t, c, want) } +func TestClassroomUser_Marshal(t *testing.T) { + t.Parallel() + testJSONMarshal(t, &ClassroomUser{}, "{}") + + u := &ClassroomUser{ + ID: Ptr(int64(1)), + Login: Ptr("octocat"), + AvatarURL: Ptr("https://github.com/images/error/octocat_happy.gif"), + HTMLURL: Ptr("https://github.com/octocat"), + } + + want := `{ + "id": 1, + "login": "octocat", + "avatar_url": "https://github.com/images/error/octocat_happy.gif", + "html_url": "https://github.com/octocat" + }` + + testJSONMarshal(t, u, want) +} + func TestClassroomAssignment_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &ClassroomAssignment{}, "{}")