From d17bf218b92feaa0ba0f874f2e71190c607495d8 Mon Sep 17 00:00:00 2001 From: vaibhavgholap23 <91172267+vaibhavgholap23@users.noreply.github.com> Date: Tue, 25 Oct 2022 19:18:47 +0530 Subject: [PATCH] Add test case for JSON resource marshaling (#2526) --- github/scim_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/github/scim_test.go b/github/scim_test.go index 7c6e14078b..d00377a972 100644 --- a/github/scim_test.go +++ b/github/scim_test.go @@ -389,3 +389,23 @@ func TestSCIMUserAttributes_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } + +func TestSCIMUserName_Marshal(t *testing.T) { + testJSONMarshal(t, &SCIMUserName{}, `{ + "givenName":"","familyName":"" + }`) + + u := &SCIMUserName{ + GivenName: "Name1", + FamilyName: "Fname", + Formatted: String("formatted name"), + } + + want := `{ + "givenName": "Name1", + "familyName": "Fname", + "formatted": "formatted name" + }` + + testJSONMarshal(t, u, want) +}