Skip to content

Commit

Permalink
Add test case for JSON resource marshaling (#2552)
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar23sj committed Oct 31, 2022
1 parent 4e394ef commit 66a053a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions github/repos_tags_test.go
Expand Up @@ -130,3 +130,19 @@ func TestRepositoriesService_DeleteTagProtection(t *testing.T) {
return client.Repositories.DeleteTagProtection(ctx, "o", "r", 1)
})
}

func TestTagProtection_Marshal(t *testing.T) {
testJSONMarshal(t, &TagProtection{}, "{}")

u := &TagProtection{
ID: Int64(1),
Pattern: String("pattern"),
}

want := `{
"id": 1,
"pattern": "pattern"
}`

testJSONMarshal(t, u, want)
}

0 comments on commit 66a053a

Please sign in to comment.