Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
air-hand committed Sep 2, 2024
1 parent 225cebc commit aedbfe2
Showing 1 changed file with 89 additions and 2 deletions.
91 changes: 89 additions & 2 deletions github/event_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6394,10 +6394,97 @@ func TestDeploymentProtectionRuleEvent_Marshal(t *testing.T) {
func TestDeploymentReviewEvent_Marshal(t *testing.T) {
testJSONMarshal(t, &DeploymentReviewEvent{}, "{}")

u := &DeploymentReviewEvent{}
u := &DeploymentReviewEvent{
Action: String("a"),
Requester: &User{
AvatarURL: String("a"),
Deleted: Bool(false),
Email: String("e"),
EventsURL: String("e"),
FollowersURL: String("f"),
FollowingURL: String("f"),
GistsURL: String("g"),
GravatarID: String("g"),
HTMLURL: String("h"),
ID: Int64(1),
Login: String("l"),
Name: String("n"),
NodeID: String("n"),
OrganizationsURL: String("o"),
ReceivedEventsURL: String("r"),
ReposURL: String("r"),
SiteAdmin: Bool(false),
StarredURL: String("s"),
SubscriptionsURL: String("s"),
Type: String("User"),
URL: String("u"),
},
Reviewers: []*RequiredReviewer{
&RequiredReviewer{
Type: String("User"),
Reviewer: &User{
AvatarURL: String("a"),
Deleted: Bool(false),
Email: String("e"),
EventsURL: String("e"),
FollowersURL: String("f"),
FollowingURL: String("f"),
GistsURL: String("g"),
GravatarID: String("g"),
HTMLURL: String("h"),
ID: Int64(1),
Login: String("l"),
Name: String("n"),
NodeID: String("n"),
OrganizationsURL: String("o"),
ReceivedEventsURL: String("r"),
ReposURL: String("r"),
SiteAdmin: Bool(false),
StarredURL: String("s"),
SubscriptionsURL: String("s"),
Type: String("User"),
URL: String("u"),
},
},
&RequiredReviewer{
Type: String("Team"),
Reviewer: &Team{
AvatarURL: String("a"),
Deleted: Bool(false),
Email: String("e"),
EventsURL: String("e"),
FollowersURL: String("f"),
FollowingURL: String("f"),
GistsURL: String("g"),
GravatarID: String("g"),
HTMLURL: String("h"),
ID: Int64(1),
Login: String("l"),
Name: String("n"),
NodeID: String("n"),
OrganizationsURL: String("o"),
ReceivedEventsURL: String("r"),
ReposURL: String("r"),
SiteAdmin: Bool(false),
StarredURL: String("s"),
SubscriptionsURL: String("s"),
Type: String("User"),
URL: String("u"),
},
},
},
}

want := `{
"fix": "me"
"action": "a",
"requester": {
"login": "l",
"id": 1,
"node_id": "n",
"avatar_url": "a",
"url": "u",
}
}`

testJSONMarshal(t, u, want)
Expand Down

0 comments on commit aedbfe2

Please sign in to comment.