From bc2743c7ccc496051d900af5851cf953fc349894 Mon Sep 17 00:00:00 2001 From: sagar23sj Date: Mon, 12 Jul 2021 17:45:06 +0530 Subject: [PATCH] Resources Covered : Label --- github/issues_labels_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/github/issues_labels_test.go b/github/issues_labels_test.go index 2d1f3ac53f3..06f4c6b6768 100644 --- a/github/issues_labels_test.go +++ b/github/issues_labels_test.go @@ -513,3 +513,29 @@ func TestIssuesService_ListLabelsForMilestone_invalidOwner(t *testing.T) { _, _, err := client.Issues.ListLabelsForMilestone(ctx, "%", "%", 1, nil) testURLParseError(t, err) } + +func TestLabel_Marshal(t *testing.T) { + testJSONMarshal(t, &Label{}, "{}") + + u := &Label{ + ID: Int64(1), + URL: String("url"), + Name: String("name"), + Color: String("color"), + Description: String("desc"), + Default: Bool(false), + NodeID: String("nid"), + } + + want := `{ + "id": 1, + "url": "url", + "name": "name", + "color": "color", + "description": "desc", + "default": false, + "node_id": "nid" + }` + + testJSONMarshal(t, u, want) +}