From dc01b85205bba4ab928cda3798dcf35971184d42 Mon Sep 17 00:00:00 2001 From: sagar23sj Date: Wed, 14 Jul 2021 01:59:50 +0530 Subject: [PATCH] Resources Covered : - Plan - OrganizationInstallations --- github/orgs_test.go | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/github/orgs_test.go b/github/orgs_test.go index ed5a0ea93ec..702949ec60b 100644 --- a/github/orgs_test.go +++ b/github/orgs_test.go @@ -401,3 +401,45 @@ func TestOrganizationsService_ListInstallations_withListOptions(t *testing.T) { return resp, err }) } + +func TestOrganizationInstallations_Marshal(t *testing.T) { + testJSONMarshal(t, &OrganizationInstallations{}, "{}") + + o := &OrganizationInstallations{ + TotalCount: Int(1), + Installations: []*Installation{{ID: Int64(1)}}, + } + want := `{ + "total_count": 1, + "installations": [ + { + "id": 1 + } + ] + }` + + testJSONMarshal(t, o, want) +} + +func TestPlan_Marshal(t *testing.T) { + testJSONMarshal(t, &Plan{}, "{}") + + o := &Plan{ + Name: String("name"), + Space: Int(1), + Collaborators: Int(1), + PrivateRepos: Int(1), + FilledSeats: Int(1), + Seats: Int(1), + } + want := `{ + "name": "name", + "space": 1, + "collaborators": 1, + "private_repos": 1, + "filled_seats": 1, + "seats": 1 + }` + + testJSONMarshal(t, o, want) +}